Skip to content

Instantly share code, notes, and snippets.

@fraserharris
fraserharris / Sharded_SQL_VIEW.py
Created May 19, 2018 01:34
Generates & executes SQL CREATE VIEWs that re-combine sharded tables in a Redshift or Postgres environment
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Sharded_SQL_VIEW.py
#
# Generates & executes SQL CREATE VIEWs that re-combine sharded tables in a Redshift or Postgres environment. The result of the script is a single schema with a SQL VIEW for each sharded table
#
# The script assumes the shards exist in separate schemas that follow the pattern:
# <schema_name>_######.<table_name>_######
# Eg: `source_schema_123.customers_2452` will become `destination_schema.customers`
#
// Safari reports "0" when no port is in the href
// IE reports "80" when no port is in the href
function getPortUsingSingleTernaryOp (url) {
var port, a = document.createElement('a');
a.href = url;
return (url.indexOf(":" + a.port) > -1) ? a.port : "";
}
function getPortUsingTernaryOp (url) {
var port, a = document.createElement('a');
@fraserharris
fraserharris / gist:61248c1284aa746d36c0
Last active August 29, 2015 14:06
Fashion-forward Web Designer

Web Designer with a flair for the fashionable

Are you a passionate web designer who experiments on Polyvore, checks Foursquare before heading out & loves creating sleek, stylish pages? We are looking for you!

Who we are

We are Second Funnel - a small, growing startup making the web more visually interesting and relevant. We believe online advertising currently sucks, but can be made awesome. Or at least less terrible. How? Through visuals that peek curiousity and lead to relevant engaging content (think Pinterest meets marketing).

@fraserharris
fraserharris / gist:aba178accbc6f38d076f
Last active August 29, 2015 14:06 — forked from wolever/gist:77aef75b2f12d46bbae9
Skinny-jeans Developer

Full-stack Software Developer with a flair for the fasionable

Are you a passionate web developer who wears skinny jeans, checks Foursquare before heading out, and builds sleek, sylish web-apps? We are looking for you!

Who we are

We are Second Funnel - a small, growing startup making the web more visually interesting and relevant. We believe advertising currently sucks, but can be made awesome. Or at least less terrible. How? Through visuals that peek curiousity and lead to interesting, engaging content (think Pinterest meets marketing).

@fraserharris
fraserharris / gist:a3ed5004eccd78da0065
Last active August 29, 2015 14:06
Fully Stacktastic Developer

Full-stack Software Developer

Are you a passionate web developer who is curious, loves challenges, and loves/can learn to love developing in Python and Javascript? We are looking for you!

Who we are

We are Second Funnel - a small, growing startup making the web more visually interesting and relevant. We believe advertising currently sucks, but can be made awesome. Or at least less terrible. How? Through visuals that peek curiousity and lead to interesting, engaging content (think Reddit meets marketing).

Full-stack Software Developer

Are you a passionate web developer who wears skinny jeans, checks Foursquare before heading out & loves developing in Python and/or Javascript (or other languages you love)? We are looking for you!

Who we are

We are Second Funnel - a small, growing startup making the web more visually interesting & relevant. We believe advertising currently sucks and it can be made awesome. How? Through visual content that peeks your curiousity & leads to more related and interesting content (think: Pinterest meets marketing).

@fraserharris
fraserharris / gist:2202508
Created March 26, 2012 02:31
git bronch - branch & checkout in one command
# git bronch - branch & checkout in one command
# > git bronch blah
# Add to .gitconfig or use command: git config alias.bronch = ...
[alias]
bronch = !"f() { git branch $1 && echo \"Created branch '$1'\" && git checkout $1; }; f"