Skip to content

Instantly share code, notes, and snippets.

@sbounmy
sbounmy / .env.production
Last active May 21, 2024 18:34
Files to deploy Rails 7 app with Kamal
KAMAL_REGISTRY_PASSWORD=xxx
RAILS_MASTER_KEY=xxxxxxxxxxxxxxx
POSTGRES_PASSWORD=xxxxxxxxxxxxx
REDIS_PASSWORD=my-redis-password
REDIS_URL=redis://:my-redis-password@n28-redis:6379/1
@zchee
zchee / actionlist.vim
Last active May 21, 2024 18:33
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@phette23
phette23 / update-repos.fish
Last active May 21, 2024 18:33
Shell script to run `git pull` inside all subdirectories which are git repositories. I keep a number of projects in a folder & this helps me avoid manually updating each.
#!/usr/bin/env fish
# similar script in Fish
# still under construction, need to quiet `git status` more effectively
function update -d 'Update git repo'
git stash --quiet
git pull
git stash apply --quiet
end
@jboner
jboner / latency.txt
Last active May 21, 2024 18:29
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@Starefossen
Starefossen / vim-cheats.md
Last active May 21, 2024 18:27
My vim cheat sheet for working with tabs and window splits.

Tabs

New Tab

  • :tabnew - new blank tab
  • :tabedit [file] - open file in tab

Cursor Movement

  • gt (:tabn) - next tab
@mischief
mischief / openbsd-cheatsheet.md
Last active May 21, 2024 18:27
openbsd cheatsheet

openbsd cheatsheet

manuals

manuals: man(1), apropos(1)

  • man man - read the manual for the pkg_info command.
  • man 5 ethers - read a manual in a specific section, such as ethers(5)
  • apropos <manname> - search for manuals by name
@berkorbay
berkorbay / github_desktop_ubuntu.md
Last active May 21, 2024 18:26
To install Github Desktop for Ubuntu

IMPORTANT

See the following links for further updates to Github Desktop for Ubuntu. These are official instructions. (also mentioned by fetwar on Nov 3, 2023)

For the sake of "maintaining the tradition" here is the updated version.

@realvjy
realvjy / ChoasLinesShader.metal
Last active May 21, 2024 18:26
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@OrionReed
OrionReed / dom3d.js
Last active May 21, 2024 18:22
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯