Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- A bottom-up recursive Postgres query on a table named 'family' | |
-- with three columns: id, parent_id, child_id | |
WITH RECURSIVE bottom_up_family ( | |
parent_id, child_id, depth, path | |
) AS ( | |
SELECT | |
fam_initial.parent_id, | |
fam_initial.child_id, | |
1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import, division, print_function | |
try: | |
from threading import local | |
except ImportError: | |
from django.utils._threading_local import local | |
_thread_locals = local() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
No dependency Python script for converting uBiome's raw data .zip | |
into a single FASTQ file. Based on | |
https://gist.github.com/boydgreenfield/805ac27e0a6b9a5adea7 | |
Usage: | |
>>>python ubiome2fastq.py ubiomedatafile.zip | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import math | |
""" | |
Statistical classification classes based on Toby Segarin's Programming Collective Intelligence. I wanted a version that was a little easier to read and didn't talk to SQLite. Its meant to be trained and tested on blocks of text. | |
This is good for separating things of discrete classes. Spam detection is used as the example in the book |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import json | |
import stripe | |
import datetime | |
# Required for OAuth flow | |
from rauth import OAuth2Service | |
# Our secret key from stripe | |
STRIPE_SECRET_KEY = 'sk_test_xxxxxxxxxxxxx' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires poster https://pypi.python.org/pypi/poster/ | |
# Requires webapp2 on App Engine for demo | |
# Example usage: | |
# import requests | |
# 'http://upload.wikimedia.org/math/4/7/9/479d9d21b183eb546b771447fcf69ddf.png' | |
# response = requests.post('http://myapp.appspot.com/i/post_from_url', {'url': wikipediaimg}) | |
import json |