Skip to content

Instantly share code, notes, and snippets.

@joelpaulkoch
joelpaulkoch / rag_time.exs
Last active September 16, 2025 16:46
A RAG for Elixir in Elixir
Mix.install(
[
{:phoenix_playground, "~> 0.1.6"},
{:phoenix, "~> 1.7.14"},
{:phoenix_live_view, "~> 1.0.0-rc.1"},
{:chroma, "~> 0.1.3"},
{:text_chunker, "~> 0.3.1"},
{:nx, "~> 0.9.0"},
{:exla, "~> 0.9.1"},
{:axon, "~> 0.7.0"},
@pivaldi
pivaldi / pim-advise-display-warning.el
Last active August 18, 2026 21:56
Filtering unwanted Emacs warning by message regexps.
;; Copyright (c) 2024, Philippe Ivaldi <www.piprime.fr>
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@PJUllrich
PJUllrich / big-o.md
Last active August 22, 2026 15:11
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for <= 32 elements, O(log n) for > 32 elements [2]
Deletion O(n) for <= 32 elements, O(log n) for > 32 elements
@slashdotdash
slashdotdash / wait_until.ex
Last active April 11, 2024 14:01
ExUnit wait until helper function
def wait_until(timeout \\ 1_000, fun)
def wait_until(0, fun), do: fun.()
def wait_until(timeout, fun) do
fun.()
rescue
ExUnit.AssertionError ->
:timer.sleep(10)
@progfolio
progfolio / general-spacemacs.org
Last active August 1, 2025 05:17
Spacemacs-like menus using general.el

Spacemacs-like menus using general.el

Global keybindings

First, we define a global prefix key:

(general-create-definer global-definer
  :keymaps 'override
  :states  '(insert emacs normal hybrid motion visual operator)
  :prefix  "SPC"
  :non-normal-prefix "S-SPC")
@madkoding
madkoding / pair-dual-boot-bluetooth.md
Last active August 27, 2026 19:01
Pairing bluetooth devices in dual boot with Linux Ubuntu and Windows 10/11

Pairing Bluetooth Devices in Dual Boot with Linux Ubuntu and Windows 10/11

Introduction

This guide provides updated instructions for pairing Bluetooth devices (such as keyboards or mice) in a dual-boot environment with Linux Ubuntu and Windows 10/11, incorporating community feedback and suggestions.

Instructions

1. Pair in Linux First

  • Pair your Bluetooth device in Linux. This is crucial to ensure the LinkKey remains consistent.
  • Note: Do not re-pair the device in Linux after completing the pairing in Windows.
@pmarreck
pmarreck / migrations_in_console_cheatsheet.exs
Created September 25, 2017 16:47
How to run Ecto migrations in Elixir/Phoenix from an `iex -S mix` or production console
# How to run Ecto migrations from IEx console... Examples
# preliminaries assumed in the following code, change to fit your environment:
alias YourAppName.Repo
your_app_name_as_atom = :mpnetwork
downto_version = 20170724182558
# Down:
Ecto.Migrator.run(Repo, "priv/repo/migrations/", :down, [to: downto_version])
@somebox
somebox / domain-driven-desire-resources.md
Last active November 16, 2024 04:16
Domain-Driven Desire: Further Reading

Domain-Driven Desire: The Talk from Øredev 2016

🎥 https://vimeo.com/191051851

Links and References

Thanks for watching my talk, Domain-Driven Desire at Øredev 2016. Here's a list of resources that inspired me, and will hopefully inspire you:

Videos

@tvlooy
tvlooy / unit.sh
Last active May 4, 2026 03:52
Bash test: get the directory of a script
#!/bin/bash
function test {
MESSAGE=$1
RECEIVED=$2
EXPECTED=$3
if [ "$RECEIVED" = "$EXPECTED" ]; then
echo -e "\033[32m✔︎ Tested $MESSAGE"
else
@bergerjac
bergerjac / capybara_cheat_sheet.rb
Last active August 29, 2015 14:15 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
# debugging
save_and_open_page
puts page.body
puts find("#id").native
puts first("#id .class element").native
# navigating
visit('/projects')
visit(post_comments_path(post))