Skip to content

Instantly share code, notes, and snippets.

View silent1mezzo's full-sized avatar

Adam McKerlie silent1mezzo

View GitHub Profile
const adventurer = {
name: 'Alice',
cat: {
name: 'Dinah'
}
};
// Before Optional Chaining
if(adventurer && adventurer.cat){
console.log(adventurer.cat.name);
@silent1mezzo
silent1mezzo / models.py
Created September 11, 2019 22:09
Swear app models.py
SWEAR_TYPES = (
(FUCK, 'Fuck'),
(BITCH, 'Bitch'),
(SHIT, 'Shit'),
(ASS, 'Ass'),
(OTHER, 'Other')
)
SWEAR_EVENT_TYPES = {
(0, 'G Stock'),
@silent1mezzo
silent1mezzo / ladder.md
Created March 5, 2018 20:42 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@silent1mezzo
silent1mezzo / fabfile-symlink.py
Created January 4, 2018 21:46
An example deployment using Fabric and Symlinks
@silent1mezzo
silent1mezzo / fabfile.py
Last active February 24, 2024 14:13
An example deployment using Fabric
# -*- coding: utf-8 -*-
import json
import requests
import getpass
import random
from fabric.api import *
from fabric.operations import *
"""
Set up servers locations. This can be programatically generated too.
Brand Model Type Count
Apple Earbuds Earbuds 5
Bose QuietComfort 35 Over Ear 4
Bose QuietComfort 20 Earbuds 3
Sony MDR-7506 Over Ear 3
Shure SE215 Earbuds 3
August EP650 Over Ear 2
Bose QuietComfort 25 Over Ear 2
Bose SoundTrue Earbuds 2
AKG K550 Over Ear 1
# Wife's Algorithm
things = get_things_to_clean()
for thing in things:
clean(thing)
# My Alogrithm
while True:
try:
clean_something()
except NothingToCleanException:
#!/bin/bash
# node.js using PPA (for statsd)
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
# Install git to get statsd
sudo apt-get install git
@silent1mezzo
silent1mezzo / gist:1773608
Created February 8, 2012 20:47
Django {% set %} templatetag
class SetVarNode(template.Node):
def __init__(self, var_name, var_value):
self.var_name = var_name
self.var_value = var_value
def render(self, context):
try:
value = template.Variable(self.var_value).resolve(context)
except template.VariableDoesNotExist:
@silent1mezzo
silent1mezzo / 0fixup.md
Last active October 15, 2024 06:44 — forked from SethRobertson/index.md
On undoing, fixing, or removing commits in git

A git choose-your-own-adventure!

This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using git. It isn't that git is so complicated that you need a large document to take care or your particular problem, it is more that the set of things that you might have done is so large that different techniques are needed depending on exactly what you have done and what you want to have happen.