Skip to content

Instantly share code, notes, and snippets.

allanlei / .env
Created January 16, 2012 21:14
Sample local Heroku/Django development environment using foreman
leon / ssh-copy-rsub
Created March 2, 2012 10:04
ssh-copy-rsub - allows you to easily copy the remote script to your server using the same syntax as ssh-copy-id
#!/bin/sh -e
# Usage: ssh-copy-rsub [--bash] [user@]machine
# Shell script to install rsub on the remove server so we can open shell scripts locally.
# Author: Leon Radley (
if [ "$#" -gt 1 ] || [ "$1" = "-b" ] || [ "$1" = "--bash" ]; then
Yukilas /
Created October 31, 2012 15:49
[Django, Gevent, SocketIO] Run script to automatically restart Gunicorn when a change is made on a python file
#!/usr/bin/env python
# -*- coding:Utf-8 -*-
import os
import shlex
import subprocess
import sys
import time
from import FileSystemEventHandler
from watchdog.observers import Observer
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'
ogrrd / dnsmasq OS
Last active May 14, 2024 08:39
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.



steipete / UIKitLegacyDetector.m
Last active March 12, 2024 13:57
A simple way to detect at runtime if we're running in UIKit legacy mode or the new "flat" variant. Written for our PDF iOS SDK (, where the precompiled binary needs to detect at runtime in what variant it's running. Want more stuff like that? Follow me on Twitter:
// Taken from This snippet is under public domain.
#define UIKitVersionNumber_iOS_7_0 0xB57
BOOL PSPDFIsUIKitFlatMode(void) {
static BOOL isUIKitFlatMode = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7.
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) {
isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0;
lisamelton /
Last active September 8, 2023 23:51
Transcode video file (works best with Blu-ray or DVD rip) into MP4 (or optionally Matroska) format, with configuration and at bitrate similar to popular online downloads.
# Copyright (c) 2013-2015 Don Melton
about() {
cat <<EOF
$program 5.13 of April 8, 2015
ardcore / atom-events
Last active October 13, 2021 20:35 events
tsiege / The Technical Interview Cheat
Last active May 19, 2024 17:40
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.


I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!