Skip to content

Instantly share code, notes, and snippets.

Avatar

Ry4an Brase Ry4an

View GitHub Profile
View gist:5031253
Name Qty. No. Description Price
Darrel 1. Kid's Burger
One extra slice of cheese
Lettuce; Tomatoes; Pickles
Side Salad
Blue Cheese 6.88
Delete
Tim 2. The Elevation Burger
One slice of cheese
@Ry4an
Ry4an / gist:4960647
Created Feb 15, 2013
dyanamodb to redshift
View gist:4960647
copy table_redshift from 'dynamodb:// table_dynamodb'
credentials 'aws_access_key_id=xxx;aws_secret_access_key=xxx'
readratio 50;
@Ry4an
Ry4an / .pythonrc
Created Feb 12, 2013
For getting history in python REPL. Mostly cribbed from stackoverflow answers
View .pythonrc
import atexit
import os
import re
import readline
import rlcompleter
import socket
import _socket
import sys
import time
try:
View gist:2715764
#!/bin/bash
THIS_FOLDER=`dirname $0`
node=$1
# What files have changed
files=`hg log --template="{files}" -r $node`
# Check each
for file in $files; do
@Ry4an
Ry4an / gist:2089965
Created Mar 19, 2012
Share doesn't save time or space vs. local clones
View gist:2089965
ry4an@ry4an:~/projects$ time hg clone mercurial mercurial.localclone
updating to branch default
964 files updated, 0 files merged, 0 files removed, 0 files unresolved
real 0m5.908s
user 0m5.092s
sys 0m0.392s
ry4an@ry4an:~/projects$ time hg --config extensions.share= share mercurial mercurial.shareupdating working directory
964 files updated, 0 files merged, 0 files removed, 0 files unresolved
@Ry4an
Ry4an / gist:2051149
Created Mar 16, 2012
grove.io connection error
View gist:2051149
This has been going on for 10 minutes now:
[eighth] (!) Irssi: Looking up irc.8thbridge.net
[eighth] (!) Irssi: Reconnecting to irc.8thbridge.net [184.106.113.202] port 6697 - use
/RMRECONNS to abort
(!) Irssi: warning SSL write error: Connection reset by peer
[eighth] (!) Irssi: Connection to irc.8thbridge.net established
(!) Irssi: warning SSL read error: server closed connection unexpectedly
[eighth] (!) Irssi: Connection lost to irc.8thbridge.net
View gist:1792078
// the solution
// 1. declare the class Number(Int)
// 2. define method Number.inc(): Number
// 3. define method Number.dec(): Number
// 4. define getNumber():Int
class Number(val n : Int) { // n cannot be changed!
def inc(): Number = new Number(n + 1)