Skip to content

Instantly share code, notes, and snippets.

View samv's full-sized avatar

Sam Vilain samv

View GitHub Profile
@samv
samv / start-ssh-agent.sh
Created September 12, 2011 21:42
SSH AUTH SOCK setter
# ~/bin/start-ssh-agent.sh
# make sure your .bashrc sources this file, I use:
#
# if [ -t ]
# then
# . ~/bin/start-ssh-agent.sh
# fi
#
# Old versions of SSH used to call the variable
# SSH_AUTHORIZATION_SOCKET; this is no longer supported.
@samv
samv / output.log
Created October 31, 2011 16:52
New commits in gerrit since 8 days ago
interzone:~/src/gerrit$ git log --all --since="8 days ago" | git shortlog | cat
Augie Fackler (1):
documentation: update links from kernel.org to code.google.com
Brad Larson (1):
Show latest patchset with cherry-picked merge
Edwin Kempin (17):
Fix NPE in set-project-parent command if parent is not specified
stream-events: fix change subject in patchset-created event
22:25 < mugwump> dbugger: here's an example of how SQLAlchemy does it, for
inspiration:
http://readthedocs.org/docs/sqlalchemy-migrate/en/latest/#user-guide
22:28 < Harzilein> dbugger: here is a thread that mentions plans for schema
migration for typo3:
http://lists.typo3.org/pipermail/typo3-team-core-v5/2009-July/000349.html
@samv
samv / countries.yaml
Created December 29, 2011 19:15
Country codes in pi
---
Abkhazia:
7840: 1
7940: 1
99544: 1
Afghanistan:
93: 1
Albania:
355: 1
Algeria:
@samv
samv / gamble.py
Created February 26, 2012 18:43
Gambler's win
import random
cups = 3
i = 0
keeping_wins = 0
changing_wins = 0
while i < 1000:
i += 1
@samv
samv / output-2.txt
Created March 14, 2012 00:28
Program which uses a slave celery
$ rm celery*; nosetests -s -v tests/test_simplified.py
test_01_task (test_simplified.TestAsync) ... foo_our_task is: <@task: test.task>
assigned!
thread is: <Thread(Thread-1, initial)>
Worker ('worker0') running!
thread is: <Thread(Thread-1, started 4456366080)>
our_task is this time: <@task: test.task>
celery@worker0 has started.
result is :<AsyncResult: 7e42d3b4-0be5-4f48-8c7d-b305a78591a8>
We're in foo_our_task! Returning 'foo bar'
@samv
samv / Orange.itermcolors
Created March 24, 2012 22:13
Sam's iTerm colors, taken from the X11/rgb.txt palette
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>
@samv
samv / exception.txt
Created May 11, 2012 18:32
How fucked is my code stack
An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getIssueCountByFixForVersion' in class com.atlassian.jira.plugin.projectpanel.impl.VersionDrillDownRenderer$RoadMapGraphingBean threw exception class com.atlassian.jira.issue.index.SearchUnavailableException : com.atlassian.util.concurrent.LazyReference$InitializationException: com.atlassian.jira.util.RuntimeIOException: java.io.FileNotFoundException: /data/jira/home/caches/indexes/issues/segments_apox (Too many open files)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:251)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:327)
at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:51)
at org.apache.velocity.runtime.parser.node
@samv
samv / x.txt
Created July 25, 2012 16:30
Reply to David
Hey David, they're quite specific with the sharkfest requirements
that the entry speed of 40min/mile is a pool time so I think you
should be fine without having a timed open water run. I've
uploaded the recent open water swims that I've done to RunKeeper
(using my Timex Global Trainer, under my swim cap), and they
show that my speed in choppy open water, wearing a wetsuit is
about 120s/100y (even though I *can* swim as fast as 90s/100y on
a sprint in a pool, even long course, that's not far off my
"easy" pace).
@samv
samv / shell.py
Created August 13, 2012 19:38
A proposal for a SQLAlchemy Shell
"""
The SQLAlchemy Shell.
This is just a wrapper for code.InteractiveConsole with some useful
defaults for using SQLAlchemy
"""
import os
import sys
from code import InteractiveConsole