Fueling Curiosity, One Insight at a Time
At Codemancers, we believe every day is an opportunity to grow. This section is where our team shares bite-sized discoveries, technical breakthroughs and fascinating nuggets of wisdom we've stumbled upon in our work.
Mar 8, 2019
When using
mockRejectedValue
with axios the data should be inside response.data
. Eg: mockRejectedValue({ response: { data: {errors: []} }, status: 400, statusText: "Bad Request" })
revath
Mar 5, 2019
echo $PATH | sed -e $'s/\:/\\\n/'g
or echo $PATH | tr ":" "\n"
to see each entry in $PATH
in separate line.revath
Mar 5, 2019
use
:focus-within
to keep the parent element visible when focus is on child. Helpful on making dropdown menu.revath
Mar 4, 2019
In
jest.fn
we can use mockFn.mockRejectedValue
and mockFn.mockResolvedValue
instead of mockFn.mockReturnValue(Promise.resolve({data: { message: "Failure", count: 1 }});
https://jestjs.io/docs/en/mock-function-api.html#mockfnmockresolvedvaluevaluerevath
Feb 20, 2019
in rails unscope doesnt used to work with joins/left_joins, but recently has been fixed and backported to 5.1 and 5.0
goromlagche
Feb 15, 2019
its better to use
https://gist.github.com/goromlagche/d0305f1bb72ea1d01372fce3c91553d1
date + Time.zone.utc_offset
rather than Time.zone.parse(date.to_s)
if you are worried about performancehttps://gist.github.com/goromlagche/d0305f1bb72ea1d01372fce3c91553d1
goromlagche
Feb 14, 2019
"you can use serveo.net to get reusable public endpoints. Example:
ssh -R github:80:localhost:4000 serveo.net
"akash
Jan 30, 2019
you can use telepresence to connect to a k8s cluster network and do things like start a local debugging session. Here is how to use local elixir observer and debug remote pods in K8S
# Install telepresence.
# Run this command to get an IEx shell connected to the cluster
telepresence --run iex --name debug@127.0.0.1 --cookie
# Find all nodes which are part of the cluster and their IP addresses
:inet_res.getbyname('dockup-headless', :a)
# Connect to one of the nodes
Node.connect(:"dockup@")
# Start observer locally
:observer.start()
emil
Jan 20, 2019
a bash function to read k8 secrets https://gist.github.com/goromlagche/4415061ee8d6ec342fa967f7fc274296
goromlagche
Jan 20, 2019
a bash function to read k8 secrets https://gist.github.com/goromlagche/4415061ee8d6ec342fa967f7fc274296
goromlagche
Showing 54 to 56 of 77 results
Ready to Build Something Amazing?
Codemancers can bring your vision to life and help you achieve your goals
- Address
2nd Floor, Zee Plaza,
No. 1678, 27th Main Rd,
Sector 2, HSR Layout,
Bengaluru, Karnataka 560102 - Contact
hello@codemancers.com
+91-9731601276