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
    In order to take a database dump or restore it on fly.io, use flyctl proxy 5499:5432 -a <app-name>. Then one can do psql postgres://<username>:<password>@localhost:5499/<dbname> to connect to the remote db
  2. Postgres index names are limited to maximum length of 63 characters.
    If index name is longer than 63 characters while running rails migration it throws error

    Code

    Index name 'index_external_reservation_airport_transfers_on_external_reservation_id' on table 'external_reservation_airport_transfers' is too long; the limit is 63 characters


    Fix is to explicitly specify the index name

    Code

    t.references :external_reservation, null: false, foreign_key: true, index: {:name => 'idx_external_reservation_airport_transfers_external_reservation'}

  3. If we want to query data for specific pages we can use PageQuery, however we cannot directly access the data. We will need to first destructure it first and then it can be passed as props.


    JavaScript

    const IndexPage = (data) => {

  4. Styled components : const Content = styled.div margin: 30px 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-gap: 2rem; ;
    <Content> lorem ipsum </Content>

    lorem ipsum will inherit all the styles passed in Content component

    cc: @iffyuva
  5. Codemancers
    is this getting recorded now. Take 5
  6. Codemancers
    found in very hardway that typeorm has timestamp & timestamptz as types. and this works differently.
  7. Codemancers
    even if you have configured a gitlab-runner for gitlab-ci and the runner’s ssh keys or api keys are used to clone the repo into the runners environment, if the build is triggered by a person who is not the member of the project you will get below error.

    Code

    fatal: remote origin already exists.
     Clean repository
     remote: You are not allowed to download code from this project.
     fatal: unable to access 'https://gitlab-ci-token:[MASKED]@example.gitlab.com/project.git/': The requested URL returned error: 403
     ERROR: Job failed: exit code 1


    The error is slightly miss leading as it says gitlab-ci-token in it, but it is occurred due to the triggering entity not being member of the project. Even if the person who triggered the project has owner access in Gitlab and is not a member of the project, you will still see this error.
  8. Codemancers
    git log has grep.

    git log --grep=“something something”

    also can do some cut head etc to read the whole commit(which generally is the goal) at once
    $git log --grep=“something something” | head -1 | cut -d” ” -f2 | xargs -I{} git show {}
  9. Codemancers
    to debug statsd servers, this is a helpful command, echo "your.statsd.counter:1|c" | nc -u -w 1 your.statsd.host.com 8125
  10. Codemancers

    Code

    +----------+---------+---------------------+------------------------+-------------+
    |          | context | matched docs scored | matched docs in result | exact match |
    +----------+---------+---------------------+------------------------+-------------+
    | must     | query   | yes                 | yes                    | yes         |
    | filter   | filter  | no                  | yes                    | yes         |
    | should   | query   | yes                 | yes                    | no          |
    | must_not | filter  | no                  | no                     | yes         |
    +----------+---------+---------------------+------------------------+-------------+


  11. Codemancers
    mac set custom default folder for screenshots defaults write com.apple.screencapture location /path/to/Screenshots
  12. Codemancers
    $stdout.sync = true

    this helps if you are trying to write a tool which pipes to another command. the other command will be able to process the output immediately, as no buffer and periodic flush is involved.
    eg. cat rules > ruby rule_engine.rb | python calculate_tax.py

    Also ARGF, sort of like a streaming STDIN. pretty cool, cause of the streaming.

Showing page 26 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