Skip to content

Instantly share code, notes, and snippets.

@danchoi
danchoi / file1.rb
Created October 28, 2011 21:40
test gist multi file
require 'open-uri'
test = 'hello world'
@danchoi
danchoi / Guardian-opf.xml
Created January 10, 2012 16:24
Guardian-opf.xml
<?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="Guardian_2010-10-15">
<metadata>
<dc-metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title>The Guardian (Unofficial)</dc:title>
<dc:language>en-gb</dc:language>
<meta content="cover-image" name="cover"/>
<dc:creator>The Guardian</dc:creator>
<dc:publisher>The Guardian</dc:publisher>
<dc:subject>News</dc:subject>
@danchoi
danchoi / gist:1700502
Created January 29, 2012 20:32
Test bash coloriz
<code>
1 todo will be per project
2 todo note attachments
3 +todo.rb color configuration option
4 buy tea bags! @cambridgeport
5 make better email response system for +kindlefeeder +kaja
6 +todo.rb make help a command with output
7 @cambridgeport buy toothpaste
8 +kaja dogood facebook
9 @email email nate back
     1	html output option
     2	+todo.rb color configuration option
     3	buy tea bags! @cambridgeport
     4	make better email response system for +kindlefeeder +kaja

     5	+todo.rb make help a command with output
     6	@cambridgeport buy toothpaste
 7	+kaja dogood facebook!
@danchoi
danchoi / api.rb
Created May 18, 2012 15:12
Following Rich Hickey's advice
# This is the command line layer of a detachable Sinatra endpoint for the JavaScript MVC api
require 'sequel'
require 'json'
require 'csv'
require 'sinatra/base'
module Api2
DB = Sequel.connect "postgres:///adatabase"
@danchoi
danchoi / 12factor.sh
Created May 24, 2012 01:50
The Twelve-Factor App philosophy in one plain text file
# Downloads the Twelve-Factor App guide from http://www.12factor.net/ and
# converts it to plain text, convenient for printing
base=www.12factor.net
out=12factor.txt
rm $out
wget -r http://$base
grep 'href.*h2' $base/index.html |
sed "s/.*href='\([^']*\)'>.*/\1/" |
while read chapter; do
@danchoi
danchoi / applicants.rb
Created August 13, 2012 17:42
reformat Boston Ruby Workshop applications
#!/usr/bin/env ruby
#
# What:
#
# This script pulls down the Google Spreadsheet for the Boston Ruby Workshop
# on August 17 and 18 and reformats it. Note that you need permissions to
# access the doc for this to work.
#
# Instructions:
#
@danchoi
danchoi / xmonad-lion.md
Created October 20, 2012 13:08
My Xmonad installation recipe for OS X Lion

My Xmonad recipe for OS X Lion

My recipe for setting up Xmonad on Ubuntu GNU/Linux is here.

What is xmonad? Read this page to learn.

Some of these instructions were adapted from the Source Matters Blog. But I also depart from those instructions in certain ways.

@danchoi
danchoi / xmonad-ubuntu.md
Created October 20, 2012 14:39
Setting up Xmonad in Ubuntu Oneiric
@danchoi
danchoi / tmux.conf
Created February 5, 2013 15:08
.tmux.conf key bindings to help navigate tmux sessions.
bind-key L switch-client -l
bind-key '"' command-prompt "switch-client -t '%%'"