Skip to content

Instantly share code, notes, and snippets.

View ghickman's full-sized avatar
🏠
hash tag farm lyfe

George Hickman ghickman

🏠
hash tag farm lyfe
View GitHub Profile
WITH ethnicities AS (
SELECT
Patient_ID,
date,
ethnicity_code,
ROW_NUMBER() OVER (
PARTITION BY Patient_ID ORDER BY date DESC
) AS row_num
FROM (
SELECT
#!/usr/local/bin/bash
# use bash 4 from homebrew
set -e
shopt -s globstar
FORMAT="%Y-%m-%d_%H-%M-%S"
# Video files
### Keybase proof
I hereby claim:
* I am ghickman on github.
* I am ghickman (https://keybase.io/ghickman) on keybase.
* I have a public key whose fingerprint is D05C 5A1C 502A 3734 9698 2B15 EEC6 7845 093B 01FD
To claim this, I am signing this object:
@ghickman
ghickman / gist:9935650
Created April 2, 2014 14:45
BOOYA Links for Oxford Python 1.12
https://www.python.org/download/releases/3.3.4/ <- Python 3.4 released
AUTHENTICATION_BACKENDS = (
'social_auth.backends.google.GoogleOAuth2Backend',
'django.contrib.auth.backends.ModelBackend',
)
LOGIN_REDIRECT_URL = '/'
GOOGLE_OAUTH2_CLIENT_ID = os.environ['GOOGLE_OAUTH2_CLIENT_ID']
GOOGLE_OAUTH2_CLIENT_SECRET = os.environ['GOOGLE_OAUTH2_CLIENT_SECRET']
GOOGLE_WHITE_LISTED_DOMAINS = ['incuna.com']
SOCIAL_AUTH_USER_MODEL = 'auth.User'
@ghickman
ghickman / generic.py
Created July 15, 2012 13:25
Generate unique slugs for Django models
from django.template.defaultfilters import slugify
def generate_slug(cls, value):
count = 1
slug = slugify(value)
if not isinstance(cls, type):
cls = cls.__class__
def _get_query(cls, **kwargs):
if cls.objects.filter(**kwargs).count():
@ghickman
ghickman / .troverc
Created July 4, 2012 14:06
Example .troverc file.
[trove]
username=me
password=secret
url=http://trove.example.com
@ghickman
ghickman / gist:1326435
Created October 30, 2011 20:59
fix broken midwich images
#!/usr/bin/env python
"""
midwich_image_fix.py
Created by Lee Perry on 2011-10-30.
Copyright (c) 2011 iCode Solutions Ltd. All rights reserved.
"""
import sys
import csv
<advancedsettings>
<moviestacking action="append">
<regexp>(.+)\(([0-9])\)()(\.[^.]+)$</regexp>
</moviestacking>
</advancedsettings>
" Remember last location in file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif
endif