Skip to content

Instantly share code, notes, and snippets.

View osazemeu's full-sized avatar

Osazeme Usen osazemeu

View GitHub Profile
@cohawk
cohawk / README.md
Last active June 18, 2025 17:14
CockroachDB fork of the postgrex adapter - Elixir Ecto caveats

Over the weekend I spun up a new Elixir :ecto, "2.2.7" project that I was able to get working with CockroachDB and this adapter fork - with some caveats I wanted to share to help others.

  1. Only the root user can create databases This requires you configure the Ecto.Adapters.Postgres username as root or else the mix ecto.create command will always fail. You can go back and change your configured username to something else after the database has been created, or create your database and user permissions using cockroach sql and skip the mix ecto.create command.

  2. Configuring Ecto primary_key ID to be created by CockroachDB By default when configuring your Ecto.Schema using autogenerate: false it appears either CockroachDB, Ecto or the Postrex adapter (I did not investigate this) uses the BIGINT unique_rowid() function as the default value for IDs

@primary_key {:id, :id, autogenerate:
@jasny
jasny / sha256-hmac.md
Last active July 16, 2025 12:32
Hashing examples in different languages

Example inputs:

Variable Value
key the shared secret key here
message the message to hash here

Reference outputs for example inputs above:

| Type | Hash |

@infoslack
infoslack / main.py
Last active April 18, 2025 13:45
Technical interview helper
# dependencies
# pip install -U openai gradio
import os, openai
import gradio as gr
openai.api_key = 'sk-xxxxxx'
messages = [{"role": "system", "content": """Assistant is an expert candidate in
technical IT job interviews. Currently, the interview is
focused on a position for Platform Engineer. So, you have skills