Skip to content

Instantly share code, notes, and snippets.

View briandailey's full-sized avatar

Brian Dailey briandailey

View GitHub Profile
~ /usr/games/cowsay -f turtle "What."
_______
< What. >
-------
\ ___-------___
\ _-~~ ~~-_
\ _-~ /~-_
/^\__/^\ /~ \ / \
/| O|| O| / \_______________/ \
| |___||__| / / \ \
@briandailey
briandailey / gist:4443624
Created January 3, 2013 13:55
cycling an uninstantiated class variable
>>> from itertools import cycle
>>> class Foo(object):
... c = cycle(['1', '2'])
...
>>> Foo.c
<itertools.cycle object at 0x1004690e0>
>>> Foo.c.next()
'1'
>>> Foo.c.next()
'2'
@briandailey
briandailey / gist:4466815
Created January 6, 2013 12:26
channels in nashville
[06:25:19] byeliad: list * -topic *nashville*
[06:25:20] -alis- Returning maximum of 60 channel names matching '*'
[06:25:20] -alis- #hacknashville 11 :Welcome to hacknashville
[06:25:20] -alis- #nashdl 46 :Talk about Nashville, Dynamic Languages, or Both: Thursday is JJ's Cafe/Broadway Brewhouse; also, we dream of weekly Saturday morning nashdl (coding!) brunch starting at 10or11:am at Frothy Monkey; Sundays coding at 10am at PB east; also, fuck flash & bundler.
[06:25:20] -alis- #nashvillephp 14 :Nashville PHP User Group • http://nashvillephp.org/ • We meet the second Tuesday of each month at 6pm • Join our discussion forums: http://forum.nashvillephp.org/ • Follow us on Twitter: @NashvillePHP
[06:25:20] -alis- #nlug 19 :Nashville Linux User Group | nlug.org
[06:25:20] -alis- #phpcon 3 :PHP Co
parseInt('10', 0)
10
parseInt('10', 1)
NaN
parseInt('10', 2)
2
diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb
dissimilarity index 99%
index 414904b..0b0b21d 100644
--- a/app/views/devise/shared/_links.erb
+++ b/app/views/devise/shared/_links.erb
@@ -1,19 +1,15 @@
-<%- if controller_name != 'sessions' %>
- <%= link_to "Sign in", new_session_path(resource_name) %><br />
-<% end -%>
-
@briandailey
briandailey / gist:5399004
Created April 16, 2013 19:47
TIL: in PostgreSQL
# select count(*);
count
-------
1
(1 row)
@briandailey
briandailey / gist:5484484
Created April 29, 2013 20:23
Multi-part Upload
import sys
import argparse
import glob
import subprocess
import boto
parser = argparse.ArgumentParser(description='Upload large (5GB+) file to Amazon S3.')
parser.add_argument('--aws_access_key_id', required=True,
@briandailey
briandailey / gist:5823747
Created June 20, 2013 15:27
Logging boto in interactive shell
# see http://boto.readthedocs.org/en/latest/ref/boto.html#boto.set_stream_logger
import boto
boto.set_stream_logger('paws')
ec2 = boto.connect_ec2(debug=2)
s3 = boto.connect_s3(debug=2)
@briandailey
briandailey / .bashrc
Created June 25, 2013 13:57
phpargs function - add to bashrc
function phpargs() {
curl -s http://us3.php.net/$1 | \
sed -n '/<div class="methodsynopsis dc-description">/,/<\/div>/p' | \
sed 's/<[^>]*>//g' | tr -d "\n"
echo
}
@briandailey
briandailey / gist:6599285
Created September 17, 2013 19:15
pip upgrade distribute before installing pandas
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
pip install -U pip