Skip to content

Instantly share code, notes, and snippets.

View ryansturmer's full-sized avatar

Ryan Sturmer ryansturmer

View GitHub Profile
#!/bin/sh
# System Update
pacman --noconfirm -Syu
#The essentials
pacman --noconfirm -S base-devel vim git
# Packer (AUR Helper)
cd /tmp
@ryansturmer
ryansturmer / .vimrc
Created November 28, 2012 21:54
My vimrc file
call pathogen#infect()
set nocompatible
set number
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
set diffexpr=MyDiff()
function MyDiff()
@ryansturmer
ryansturmer / git_cheat_sheet.md
Last active October 12, 2015 14:48
Git Cheat Sheet

Git Cheat Sheet

This attempts to be a useful "cheat sheet" for git. I'm just writing git recipes down here as I find and use them.

Getting Code

Clone a repository (GitHub)

git clone [email protected]:username/repository.git
@ryansturmer
ryansturmer / get_sdk.py
Created August 21, 2012 02:04
Downloads, extracts, and installs the mozilla add-on SDK. Handy script to include in your add-on source tree.
import sys, os, urllib, shutil
from urlparse import urlparse
from zipfile import ZipFile
SDK_DIR = 'sdk'
TMP_DIR = os.path.join(SDK_DIR, 'tmp')
MOZILLA_SDK = 'https://ftp.mozilla.org/pub/mozilla.org/labs/jetpack/addon-sdk-1.9.zip'
VOLD_UTILS = 'https://github.com/voldsoftware/vold-utils-jplib/zipball/master'
VOLD_MENUITEMS = 'https://github.com/voldsoftware/menuitems-jplib/zipball/master'
@ryansturmer
ryansturmer / dov.py
Created August 2, 2012 15:01 — forked from anonymous/dov.py
The Dov problem
# Counting Squares Problem
# Code derived from original script by Keith Brafford
#
import itertools
coords = [(0,0), (1,0), (2,0), (3,0), (4,0),
(1.5,.5), (2,.5), (2.5,.5),
(0,1), (1,1),(1.5,1), (2,1), (2.5,1), (3,1), (4,1),
(1.5,1.5), (2,1.5), (2.5,1.5),
(0,2), (1,2), (2,2), (3,2), (4,2),
@ryansturmer
ryansturmer / base64image.py
Created August 1, 2012 15:27
Convert Images to Base64 Encoded HTML
import base64
import os
def convert(infile):
with open(infile, 'rb') as fp:
data = fp.read()
b64 = base64.b64encode(data)
with open("%s.htm" % os.path.splitext(infile)[0], 'w') as fp:
@ryansturmer
ryansturmer / montyhall.py
Created July 30, 2012 04:48
Python Simulation of the Monty Hall Problem for N-Doors
#
# Monty Hall Problem Simulation
# Author: Ryan Sturmer
#
import random
def play_round(doors, switch):
# Choose the location of the car