Skip to content

Instantly share code, notes, and snippets.

@aliou
aliou / postmortem.md
Created May 5, 2020 14:32 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym

While going source spelunking, I came across this piece of code in Rails' ActiveModel:

key = "#{key.to_s.camelize}Validator"

begin
  validator = key.include?("::".freeze) ? key.constantize : const_get(key)
rescue NameError
@aliou
aliou / autoload-swiftcomplete.vim
Created April 28, 2018 12:28
autoload/swiftcomplete.vim
let s:cpo_save = &cpoptions
set cpoptions&vim
function! s:reduce(fct, list) abort
let [l:acc; l:tail] = a:list
while !empty(l:tail)
let [l:head; l:tail] = l:tail
let l:acc = a:fct(l:acc, l:head)
endwhile
@aliou
aliou / phoenix_to_umbrella
Created December 29, 2017 15:09 — forked from emilsoman/phoenix_to_umbrella
How to move an existing phoenix app under an umbrella app
How to convert existing phoenix app to an umbrella app.
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134
chrismccord [10:14 PM]
@alanpeabody yes, it's straightforward
[10:14]
1) mix new my_umbrella --umbrella
@aliou
aliou / .profile
Created September 22, 2016 14:00 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else

Keybase proof

I hereby claim:

  • I am aliou on github.
  • I am aliou (https://keybase.io/aliou) on keybase.
  • I have a public key whose fingerprint is EF26 D9C3 24D0 3D5C 4801 41C1 FDB9 009E BEBF E584

To claim this, I am signing this object:

@aliou
aliou / gist:d6c5c04313255269165a
Created November 19, 2015 18:26 — forked from technoweenie/gist:1072829
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
@aliou
aliou / index.md
Last active September 8, 2015 12:46 — forked from rstacruz/index.md
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one