TILs
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.
- a sample/template rspec spec to test concurrent api calls. https://gist.github.com/goromlagche/835bd371d5e4825580e8c9e4430c7ea2
- Never Wrap a component with HOC inside the render method. This will cause numerous unmount and mount of same component on each render.
- 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 - In ssh url
[email protected]:code-mancers/engineering-blog.gitgit is the user on github.com server. Evenssh://[email protected]/engineering-blog.gitis 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. - 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.
- always use default props while writing react component, reduces the number of unexpected bugs which are hard to reproduce.
atags without anhrefare not links, they are placeholders for links. Also, capybara only click on links which have the href attribute.- Difference between usage of size/count/length when dealing with ActiveRecord::Relations and got rid of many
COUNT(*)queries. Good article on the same - http://work.stevegrossi.com/2015/04/25/how-to-count-with-activerecord/ - Postgres VACUUM [https://www.postgresql.org/docs/9.1/static/sql-vacuum.html] - It reclaims storage occupied by dead tuples.
- Rspec's
subjectis a special variable that refers to the object being tested. It's instantiated implicitly but can also be done explicitly. Handy to be used with shoulda matchers. - In Tmux, prefix+t shows the current time in big font size
- about StringIO http://ruby-doc.org/stdlib-1.9.3/libdoc/stringio/rdoc/StringIO.html so useful in certain cases
- looping through a collection of records in database using methods like
allis very inefficient (it tries to instantiate all objects at once) and should resort to batch processing methods eg:find_each. - ansible lets u use ansible_distribution ( values : Ubuntu, CentOS etc), ansible_distribution_release (values : xenial, precise etc) to write dist specific commands
- There is a global location for git ignore *nix -
~/.config/git/ignore - open chrome devtools, press cmd(ctrl) + shift + p and type show coverage and press enter, once you reload the page you can see the amount of JS fetched and how much is actually getting used on that page
- ruby has a permutation method for Array. https://apidock.com/ruby/Array/permutation
Array.from()takes a second argument which is amap. Example:Array.from(Array(10), (element, index) => //some logic to fill the array)- this seems a pretty cool library http://shrinerb.com/
- Rails console does lazy connection to database and this behaviour can be changed with by adding
ActiveRecord::Base.connectionto console config block.
Showing page 37 of 42
Your competitors are already using AI. The question is how fast you want to unlock the value.
Don't know where to start?
AI is everywhere but it's unclear which investments will actually move your metrics and which are expensive experiments.
Your data isn't ready
Most AI projects fail at the data layer. Pipelines, quality, access all need work before LLMs can deliver value.
Internal teams are stretched
Your engineers are shipping product. They don't have capacity to also become AI specialists with production-grade experience.
Legacy systems block everything
Aging, undocumented codebases make AI integration slow, risky, and expensive. They need to move first.
Don't worry. We've got you covered.
Start with the audit.