Skip to content

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.

  1. Codemancers
    We can filter sensitive parameters from getting logged by modifying config like Rails.application.config.filter_parameters += [:password, :credit_card] within automatically created filter_parameter_logging.rb file in config/initializers folder.
  2. Codemancers
    xdotool type $(echo "A B C") will type without spaces. if you need to retain space xdotool type "${echo "A B C"}"
  3. Codemancers
    graphql request with 1) curl : curl -X POST http://localhost:3002/graphql -H 'Content-Type: application/json' -d '{"query": "{goalTypes{id}}"}' 2) httpie : http POST http://localhost:3002/graphql query="{ goalTypes{id}}"
  4. Codemancers
    graphql request with 1) curl : curl -X POST http://localhost:3002/graphql -H 'Content-Type: application/json' -d '{"query": "{goalTypes{id}}"}' 2) httpie : http POST http://localhost:3002/graphql query="{ goalTypes{id}}"
  5. Codemancers
    when starting rails server with puma if you get error puma/launcher.rb:343:in stat': No such file or directory @ rb_file_s_stat - try to cd back to parent directory and then cd` to project folder again. There is chance that you moved your project to another directory and your shell is not updated with new path.
  6. Codemancers
    when starting rails server with puma if you get error puma/launcher.rb:343:in stat': No such file or directory @ rb_file_s_stat - try to cd back to parent directory and then cd` to project folder again. There is chance that you moved your project to another directory and your shell is not updated with new path.
  7. Codemancers
    Open file in vim with cursor in specific line. vim <file> +lineno Ed: vim abc.rb +343
  8. Codemancers
    The Forwardable module in Ruby provides delegation of specified methods to a designated object, using the methods def_delegator and def_delegators.
  9. Codemancers
    Ram talks with the computer with the help of a memory controller on the CPU. So the reason why its often suggested to prefer to have multiple RAM modules rather than a single one is due to memory channels. If the memory controller within the CPU supports multi-channel architecture then it can leverage it having multiple RAMs than having a single one as it helps in faster data exchange. Like if it’s dual channel then a pair, quad channel then four modules, etc.
  10. Codemancers
    Rspec has argument matchers any_args for matching any number of args at any point in an arg list and anything for matching anything and everything.
  11. Codemancers
    Capybara defaults to requiring an href attribute exist when finding links. To handle such cases we can pass href: nil as an option thus enabling to find it.
  12. Codemancers
    Rails has an ActiveSupport::Notifications module which is a part of its core instrumentation API. This API allows users to define hooks on events. With the ActiveSupport::Notifications you can instrument an event by simply calling instrument with a name, payload and a block. The notification will be sent after the block returns. Now all you need is to define subscribe method which consumes the event based on event name and you can define your on callback code here, sort of like a Pub/sub pattern.
  13. Codemancers
    you can pass options.args << ‘--headless’ to firefox newer versions, no need for headless gem \r
    \r
    options = Selenium::WebDriver::Firefox::Options.new\r
    options.args << ‘--headless’\r
    Capybara::Selenium::Driver.new(app,browser: :firefox, options: options)
  14. Codemancers
    To remove unwanted hex packages from mix.lock file, use mix deps.unlock --unused command

Showing page 32 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.

Book a free discovery call