Skip to content

Instantly share code, notes, and snippets.

View n-at-han-k's full-sized avatar
🚀

Nathan Kidd n-at-han-k

🚀
View GitHub Profile
@neilhawkins
neilhawkins / list-of-salutations-titles-honorifics.txt
Last active November 28, 2025 17:56
List of salutations, honorifics, titles, Mr, Mrs, Sir in plain text
Admiral
Air Chief Marshal
Air Commodore
Air Marshal
Air Vice Marshal
Alderman
Ambassador
Ambassador-at-Large
Archbishop
Archbishop Emeritus
@Syncthetic
Syncthetic / stack.js
Created January 19, 2019 09:56
Stack Implementation in JavaScript
class Stack {
constructor(list) {
this.list = {}
this.count = 0
}
push(value) {
this.list[this.count] = value
this.count++
}
@ntamvl
ntamvl / rails-transactions-complete-guide.md
Created October 23, 2017 04:41
Rails transactions: The Complete Guide (Just for me to learn)

Rails transactions: The Complete Guide (Just for me to learn)

Rails transactions are a way to ensure that a set of database operations will only occur if all of them succeed. Otherwise, they will rollback to the previous state of data.

Our examples will demonstrate it in the most useful scenario for transactions: money transfers. In this case, you only want Ted to receive money if John loses the same money. Basic usage

def transfer_money
 ActiveRecord::Base.transaction do
@palopezv
palopezv / dwm_config_pulseaudio.h
Last active December 29, 2025 21:53 — forked from neuro-sys/dwmconfig.h
dwm volume control with hardware multimedia keys (pipewire, pulseaudio, amixer and light as an extra)
/**
* dwmconfig.h
* Hardware multimedia keys
*/
/* Somewhere at the beginning of config.h include: */
/*
You obviously need the X11 development packages installed, X11proto in particular, but
here is the location of the keysyms header upstream copy if you can't bother
using the contents of your own hard drive. ;-P
@Syncthetic
Syncthetic / stuff.js
Created February 9, 2017 23:23
ko stuffs
const Label = {
B1 : 'event_btn_1',
B2 : 'event_btn_2',
B3 : 'event_btn_3',
CNT : 'continue',
ION : 'LithiumIon',
ION_H : 'LithiumIon_TD',
MTL : 'LithiumMetal',
MTL_H : 'LithiumMetal_TD',
};
@phansch
phansch / yardoc_cheatsheet.md
Last active December 24, 2025 15:48 — forked from chetan/yardoc_cheatsheet.md
Improved YARD cheatsheet
@jatcwang
jatcwang / gist:ae3b7019f219b8cdc6798329108c9aee
Created February 2, 2017 23:44
List of all setxkbmap configuration options (including models/layout/etc)
! model
pc101 Generic 101-key PC
pc102 Generic 102-key (Intl) PC
pc104 Generic 104-key PC
pc105 Generic 105-key (Intl) PC
dell101 Dell 101-key PC
latitude Dell Latitude series laptop
dellm65 Dell Precision M65
everex Everex STEPnote
flexpro Keytronic FlexPro
@Rich-Harris
Rich-Harris / service-workers.md
Last active January 6, 2026 09:45
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@cookrn
cookrn / screenfetched.rb
Created May 27, 2016 17:00
An easy way to cache `screenfetch` results for a set amount of time so that every new terminal doesn't re-run it
#!/usr/bin/env ruby
if fetched_file_blank? or fetched_file_expired?
fetch!
end
write_cached_screenfetch!
BEGIN {
COMMAND = 'screenfetch'.freeze
@wiseleyb
wiseleyb / setup-rails-nginx-https-dev-box-mac.md
Last active January 1, 2025 02:24
Setup a Rails, NGINX, HTTPS dev box

Setup a Rails, NGINX, HTTPS dev box

I was implementing https://layer.com/ on https://zeemee.com and they require https for the callbacks. Since this was new to me and took me a while here's a how to if anyone is looking.

Assumptions

You already have a rails app running on localhost:3000

Static IP Address