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 15, 2018
Use AbortController to cancel the promise.
/code
const controller = new AbortController();
const signal = controller.signal;
// pass this signal as option in your fetch request
fetch(url, {signal}).then(...).catch(...)
// now you can reject the above promise by calling abort like this
signal.abort()
//promise will get rejected with error "AbortError"
/code
const controller = new AbortController();
const signal = controller.signal;
// pass this signal as option in your fetch request
fetch(url, {signal}).then(...).catch(...)
// now you can reject the above promise by calling abort like this
signal.abort()
//promise will get rejected with error "AbortError"
Harshwardhan
Mar 13, 2018
preloading data for custom sql,
profiles = Profile.find_by_sql(sql_query)
ActiveRecord::Associations::Preloader.new.preload(profiles, :user)
Some more stuff here http://cha1tanya.com/2013/10/26/preload-associations-with-find-by-sql.html
profiles = Profile.find_by_sql(sql_query)
ActiveRecord::Associations::Preloader.new.preload(profiles, :user)
Some more stuff here http://cha1tanya.com/2013/10/26/preload-associations-with-find-by-sql.html
Mrinmoy
Mar 13, 2018
rendering templates outside of controller "SomeController.render :index, formats: :csv, locals: { users: users }"
Mrinmoy
Mar 5, 2018
We can specify integrity and crossorigin on link and script tags. More here https://hacks.mozilla.org/2015/09/subresource-integrity-in-firefox-43/
Yuva
Co-founder
Mar 5, 2018
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden Looks like this attribute can be used to preload content, or am I wrong?
Yuva
Co-founder
Feb 26, 2018
a sample/template rspec spec to test concurrent api calls. https://gist.github.com/goromlagche/835bd371d5e4825580e8c9e4430c7ea2
Mrinmoy
Feb 21, 2018
Never Wrap a component with HOC inside the render method. This will cause numerous unmount and mount of same component on each render.
Revath
Feb 20, 2018
Vim tip - Hitting g Ctrl-g will show you some tech info about the current file, like number of words or how many bytes it has
-- Col 1 of 25; Line 184 of 184; Word 471 of 472; Byte 4266 of 4291
-- Col 1 of 25; Line 184 of 184; Word 471 of 472; Byte 4266 of 4291
Atul
Feb 15, 2018
In ssh url
git@github.com:code-mancers/engineering-blog.git
git is the user on github.com server. Even ssh://code-mancers@github.com/engineering-blog.git
is a valid git url since git tries to clone it but since there is no code-mancers user on github hence git is not able to clone it.Atul
Feb 13, 2018
You can use https://www.fullstory.com to record user sessions and play back interactions. UX designers use this tool to understand how to improve their design.
Emil
Showing 69 to 71 of 80 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