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.

Published
Author
user-image
Manu
Ruby by default has certain mutable and immutable object types. Booleans and numbers for example are immutable, and this in turn affects the way how a variable is passed to a method i.e pass by value or reference.
Published
Author
user-image
Akshay
Ruby has a class called SimpleDelegator which can be used to used to implement decorator pattern. It can be used to delegate all supported method calls to the object passed into the constructor.
Published
Author
user-image
Emil
You can use a tool called [Telepresence](https://www.telepresence.io) to create a 2-way proxy between your local dev machine and a k8s cluster. Uses : be able to inherit env vars and other configs from k8s locally, make use of other services running in the cluster when running your dev instance of a service you want to test
Published
Author
user-image
Emil
You can speed up image builds by making use "--cache-from". This is useful when 1) you already have a previous version of the image which you can pull 2) docker pull is faster than docker build 3) intermediate layers in the previous version can be reused. This is useful for speeding up builds in docker container builder
Published
Author
user-image
Yuva
Co-founder
There is something called QoS for pods using which we can prevent unwanted rescheduling of pods
Published
Author
user-image
Emil
you can use GCP cloud shell and use it to run kubectl commands instead of having to create a k8s context on your local kubectl CLI tool. This is very useful for doing some adhoc debugging on a k8s cluster you have access to. Just login to google cloud using google auth, and then click on "Connect" next to the cluster you want to connect to, then use cloud shell.
Published
Author
user-image
Akshay
We can leverage structs in ruby to encapsulate and hold internal class data into a struct object. Since struct saves us from writing attr_accessor methods or initializer method, we can easily leverage it when in need of a temporary data structure and need to have the data grouped.

Showing 66 to 68 of 82 results

Ready to Build Something Amazing?

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