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.

Apr 5, 2019
How to extract a nested yaml key from a file and write its contents to another file?

js-yaml | jq ".topkey.nestedkey" | js-yaml > output.yaml
iffyuva
Iffyuva
Apr 4, 2019
To avoid diff of package-lock.json in git show: git show ':(exclude)package-lock.json'
revath
Revath
Mar 29, 2019
if you use kaminari(or any pagination) eventually you might want to move to https://github.com/kaminari/kaminari#paginating-without-issuing-select-count-query pagination with just prev and next button. When you have a lot of records, that extra count query might add 100-200ms on page load.
goromlagche
Goromlagche
Mar 10, 2019
To determine public IP address, use this command curl -s checkip.dyndns.org
iffyuva
Iffyuva
Mar 8, 2019
jest: When using mockRejectedValue with axios the data should be inside response.data. Eg: mockRejectedValue({ response: { data: {errors: []} }, status: 400, statusText: "Bad Request" })
revath
Revath
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
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
Revath
Mar 5, 2019
use :focus-within to keep the parent element visible when focus is on child. Helpful on making dropdown menu.
revath
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#mockfnmockresolvedvaluevalue
revath
Revath
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
Goromlagche

Showing 58 to 60 of 82 results

Ready to Build Something Amazing?

Codemancers can bring your vision to life and help you achieve your goals