This attempts to be a useful "cheat sheet" for git. I'm just writing git recipes down here as I find and use them.
Clone a repository (GitHub)
git clone [email protected]:username/repository.git
#!/bin/sh | |
# System Update | |
pacman --noconfirm -Syu | |
#The essentials | |
pacman --noconfirm -S base-devel vim git | |
# Packer (AUR Helper) | |
cd /tmp |
call pathogen#infect() | |
set nocompatible | |
set number | |
source $VIMRUNTIME/vimrc_example.vim | |
source $VIMRUNTIME/mswin.vim | |
set diffexpr=MyDiff() | |
function MyDiff() |
This attempts to be a useful "cheat sheet" for git. I'm just writing git recipes down here as I find and use them.
Clone a repository (GitHub)
git clone [email protected]:username/repository.git
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' |
# 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), |
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: |
# | |
# Monty Hall Problem Simulation | |
# Author: Ryan Sturmer | |
# | |
import random | |
def play_round(doors, switch): | |
# Choose the location of the car |