Skip to content

Instantly share code, notes, and snippets.

View pinkerton's full-sized avatar

Stephen Pinkerton pinkerton

View GitHub Profile
@joshmvandercom
joshmvandercom / madeofcode.vim
Created August 31, 2011 16:59
Port of Made of Code Theme to VIM
" Port of my favorite theme Made of Code by Mark Dodwell
" For Textmate Theme visit - http://madeofcode.com/posts/29-photo-my-new-textmate-theme-8220-made-of-code-8221-mdash-download-9-feb-2010-update-t
" Vim color file
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
@labe-me
labe-me / Makefile.osx
Created September 3, 2011 10:31
openFrameworks Makefile for osx
# openFrameworks OS X makefile
#
# make help : shows this message
# make Debug: makes the application with debug symbols
# make Release: makes the app with optimizations
# make: the same as make Release
# make CleanDebug: cleans the Debug target
# make CleanRelease: cleans the Release target
# make clean: cleans everything
#
anonymous
anonymous / highlight.sh
Created October 4, 2011 21:37
Highlight lines matching pattern
# Used as a drop-in replacement for grep that colors matching lines, but prints all lines
function highlight() {
local args=( "$@" )
for (( i=0; i<${#args[@]}; i++ )); do
if [ "${args[$i]:0:1}" != "-" ]; then
args[$i]="(${args[$i]})|$"
break
fi
done
grep --color -E "${args[@]}"
anonymous
anonymous / miu.py
Created January 2, 2012 20:57
Crude MIU System Simulator
#!/usr/bin/python -tt
import sys
def rule1(s):
if s[-1:] == 'i':
return [s + 'u']
return [s]
def rule2(s):
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@hrldcpr
hrldcpr / tree.md
Last active June 8, 2024 18:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@evilpie
evilpie / disassembler.js
Created April 4, 2012 11:51
Disassembler for Notch's 'DCPU-16'
/* See: http://0x10c.com/doc/dcpu-16.txt */
function hex(n) {
return '0x' + n.toString(16);
}
function disassemble (code) {
var PC = 0;
var operand = function (bits) {
@maxim
maxim / tm2iterm.rb
Created June 10, 2012 04:04
Convert TextMate themes into iTerm 2 color schemes.
#!/usr/bin/env ruby
#
# This script is an astonishing feat of top notch
# rockstar craftsmanship. It totally uses artificial
# intelligence to extract colors out of tmTheme and
# build an itermcolors scheme file for iTerm2.
#
# I know this sounds crazy, but it actually knows
# approximately what colors should be used in the
# ANSI list, and tries to find nearest colors from
@retgef
retgef / pug-bomb.php
Created June 24, 2012 07:46
Pug Bomb API Endpoint WordPress Plugin
<?php
/*
Plugin Name: Pug Bomb API Endpoint
Description: Adds an API endpoint at /api/pugs/$n_pugs
Version: 0.1
Author: Brian Fegter
Author URL: http://coderrr.com
*/
class Pugs_API_Endpoint{