Skip to content

Instantly share code, notes, and snippets.

View GeorgeErickson's full-sized avatar

George Erickson GeorgeErickson

View GitHub Profile
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name and in the rewrite rule) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;

Austin Survey

This shows the locations that have > 200k people within 20min.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
sudo apt-get install vim
sudo apt-get install git-core
sudo apt-get -y install nodejs
update-alternatives --set editor /usr/bin/vim.tiny
@GeorgeErickson
GeorgeErickson / example.rb
Created December 10, 2013 00:50
example gist
class Foo
def bar
22
end
end
@GeorgeErickson
GeorgeErickson / bulk_rename_column.sql
Last active December 30, 2015 10:19
I needed to rename columns that were in every table to switch from Rails to Sails.js.
CREATE OR REPLACE FUNCTION bulk_rename_column(old_name text, new_name text) RETURNS SETOF text AS $$
DECLARE
r RECORD;
BEGIN
FOR r IN SELECT table_schema, table_name, column_name
FROM information_schema.columns As c
WHERE c.table_schema NOT IN('information_schema', 'pg_catalog')
AND c.column_name = old_name
ORDER BY c.table_schema, c.table_name, c.column_name
LOOP
@GeorgeErickson
GeorgeErickson / lunchy-completion.bash
Created October 23, 2013 18:49
Super simple bash completion for lunchy
__lunchy() {
COMPREPLY=()
local current=${COMP_WORDS[COMP_CWORD]}
if [[ $COMP_CWORD == 1 ]]
then
COMPREPLY=(start stop restart ls list status install show edit)
else
COMPREPLY=($(compgen -W '$(lunchy list)' -- $current))
fi
}
# usage:
# it "should return a result of 5" do
# eventually { long_running_thing.result.should eq(5) }
# end
module AsyncHelper
def eventually(:options = {})
timeout = options[:timeout] || 2
interval = options[:interval] || 0.1
time_limit = Time.now + timeout
loop do
#!/usr/bin/env coffee
crypto = require 'crypto'
url = require 'url'
http = require 'http'
stream = require 'stream'
util = require 'util'
argv = require('optimist')
.usage('Usage $0')
.default('p', 80)