Skip to content

Instantly share code, notes, and snippets.

View offby1's full-sized avatar

Eric Hanchrow offby1

View GitHub Profile
@offby1
offby1 / invoice.py
Last active December 16, 2015 21:48 — forked from anonymous/invoice.py
import collections
itemData = collections.defaultdict(list)
print('Reading rows...')
for row in range(10, 19):
# Each row in the spreadsheet has data for one item.
item = sheet['A' + str(row)].value
itemData['item'].append(item)
description = sheet['C' + str(row)].value
@offby1
offby1 / parse.py
Last active November 11, 2015 18:14 — forked from ysinc88/readme.txt
Creating new lines from the commas inside quotes
import codecs
import csv
import sys
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
with open('sample.csv', encoding='utf-8') as inf:
r = csv.reader(inf)
for line in r:
print(line)
@offby1
offby1 / jinja.tmp
Last active October 28, 2015 21:05 — forked from anonymous/jinja.tmp
%{ for count in range(0, multis) -%}
%{{ count %}} & A & B & C & D\\ \hline
%{ set count = count + 1 -%}
%{ endfor -%}
%{{ multis %}} & X & X & X & X\\ \hline
@offby1
offby1 / track_spree
Created March 11, 2012 20:23
TRACKS CHANGES TO PARTS OF SPREE SINCE A GIVEN COMMIT
#!/usr/bin/env zsh
# 1304046900 TRACKS CHANGES TO PARTS OF SPREE SINCE A GIVEN COMMIT
# To be placed in the root of your app.
old_commit="32483802d823e92c0746d080217870dd48f49307"
parts=(
core/app/assets/javascripts/store/checkout.js
@offby1
offby1 / gist:1240799
Created September 25, 2011 16:27 — forked from zkat/gist:1240784
git-grep in emacs
;; There's something similar (but fancier) in vc-git.el: vc-git-grep
;; -I means don't search through binary files
;; --no-color, oddly enough, is required to allow emacs to colorize the output
(defcustom git-grep-switches "--extended-regexp -I -n --ignore-case --no-color"
"Switches to pass to `git grep'."
:type 'string)
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 8.
"DN","objectClass","homeMDB","name","displayName","mail","givenName","sAMAccountName","mailnickname","msExchHomeServerName","mDBUseDefaults"
"CN=%%k,OU=Users,OU=2013,OU=Secondary,OU=Students,OU=Users,OU=dn1,DC=dn2,DC=dn3,DC=dn4,DC=dn5","%%j","CN=2013","%%k","%%k","%%[email protected]","%%k","%%k","%%[email protected]","CN=InformationStore,CN=server1,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=shortAD,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=dn1,DC=dn2,DC=dn3,DC=dn4","TRUE"
file2
fn1sn1,fn1,sn1
fn1sn2,fn2,sn2
fn1sn3,fn3,sn3
file3
for /f "tokens=1,2,3 delims=, " %%i in (file1.csv) do csvde -i -k -f file2.csv -j .\
# terminology
^^[[TOC]]^^
### general VCS terminology
A **project** is the minimum set of source code (and related files) that need
to be kept together to **build** the software. Example: Linux
* each project will have one **repository**
git submodule add git://github.com/eschulte/rinari.git vendor/rinari
git submodule add git://github.com/defunkt/markdown-mode.git vendor/markdown-mode
git submodule add git://github.com/crafterm/twilight-emacs.git vendor/twilight-emacs
git submodule add git://github.com/avvo/fuzzy-find-in-project.git vendor/fuzzy-find-in-project
git submodule add git://github.com/technomancy/magit.git vendor/magit
git submodule add git://github.com/defunkt/cheat.el.git vendor/cheat.el
git submodule add git://github.com/defunkt/gist.el.git vendor/gist.el
git submodule add git://github.com/defunkt/textmate.el vendor/textmate.el