Skip to content

Instantly share code, notes, and snippets.

View briandailey's full-sized avatar

Brian Dailey briandailey

View GitHub Profile
> var s = "this is a string";
undefined
> s.slice(-1);
'g'
> s.substring(-1);
'this is a string'
@briandailey
briandailey / gist:8718465
Last active August 29, 2015 13:55
Nashville facts & figures
Income per capita http://research.stlouisfed.org/fred2/series/NASH947PCPI
obesity map http://www.tennessean.com/assets/jpg/DN15498243.JPG
Metro planning department (nashville) API WSDL (SOAP)
http://maps.nashville.gov/MPC_Notification/MPC_Notification.asmx
@briandailey
briandailey / gist:8288191
Created January 6, 2014 19:20
Updating Heroku to Postgres 9.3
# https://github.com/heroku/heroku-pg-extras#pgbackupstransfer
# create a url
heroku addons:add heroku-postgresql:standard-yanari
heroku pg:wait
heroku pgbackups:transfer [oldbcolor] [newdbcolor]
@briandailey
briandailey / gist:6604310
Created September 18, 2013 03:46
Hit explainshell.com for help.
function halpme() { curl -s "http://explainshell.com/explain/$1" --data-urlencode "args=${@:2}" -G | sed -n '/<table id="help"/,/<\/table>/p' | sed 's/ *//' | sed 's/<[^>]*>//g' | grep -v "^$" }
# EX:
# ~ ❯ halpme tar -xzf
# The GNU version of the tar archiving utility
# -x, --extract, --get
# extract files from an archive
# -z, --gzip, --gunzip --ungzip
# -f, --file ARCHIVE
# use archive file or device ARCHIVE
@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
@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: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 / 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:5399004
Created April 16, 2013 19:47
TIL: in PostgreSQL
# select count(*);
count
-------
1
(1 row)
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 -%>
-