Skip to content

Instantly share code, notes, and snippets.

View gourneau's full-sized avatar

Joshua Gourneau gourneau

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" media="all" href="/site_media/resources/bootstrap/css/bootstrap.min.css" type="text/css">
<script type="text/javascript" src="/site_media/resources/jquery/jquery-1.8.2.js"></script>
<script type="text/javascript" src="/site_media/resources/bootstrap/js/bootstrap.min.js"></script>
import random
class shorter_float(float):
"""A float which returns only 3 digits after the decimal"""
def __repr__(self):
return "%0.3f" % self
ires = 100.0 # Inverse resolution
left = -100
right = 101
{ "pluginconfig" :
{
"torrent_variant_caller":{
"downsample_to_coverage":2000,
"min_indel_count_for_genotyping":5,
"min_mapping_quality_score":4,
"min_allele_frequency":0.2,
"hp_low_stringency":0,
"hp_min_cov_each_strand":3,
"hp_stb_fpe_min_coverage":30,
from __future__ import division
import requests
import math
import sys
def human_size(size_bytes):
"""
format a size in bytes into a 'human' file size, e.g. bytes, KB, MB, GB, TB, PB
Note that bytes/KB will be reported in whole numbers but MB and above will have greater precision
e.g. 1 byte, 43 bytes, 443 KB, 4.3 MB, 4.43 GB, etc
@gourneau
gourneau / launch.sh
Created January 11, 2013 00:21
Plugin to create PDF at the end of a run for Ion Torrent
#!/bin/bash
VERSION="0.1"
#Set the URL for the API requests
plugin_url=http://127.0.0.1/rundb/api/v1/results/${RUNINFO__PK}/plugin/
page_url=http://127.0.0.1/${RUNINFO__URL_ROOT}/
#Set the HTTP Headers
api_header="Content-Type: application/json;Accept: application/json"
@gourneau
gourneau / slice_long_images.py
Created January 9, 2013 20:59 — forked from anonymous/slice_long_images.py
This is a bit of Python code that uses PIL to slice very long images into segment sizes of your choice. For example take a 10,000px tall image, and slice it into 10 10,00px tall images.
import Image
from __future__ import division
import math
import os
"""
This is a bit of Python code that uses PIL to slice very long images into segment sizes of your choice.
For example take a 10,000px tall image, and slice it into 10 10,00px tall images.
thanks to the great docs at http://www.packtpub.com/article/python-image-manipulation
@gourneau
gourneau / index.html
Created December 1, 2012 23:15 — forked from mbostock/.block
World Countries
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.country {
fill: #b8b8b8;
stroke: #fff;
stroke-width: .5px;
stroke-linejoin: round;
}
@gourneau
gourneau / jobsearch.py
Created November 18, 2012 05:01
github jobsearch
import requests
import json
search = "https://jobs.github.com/positions.json?description=python&location=San+Francisco"
attempts = 100
worked = 0
for count, attempt in enumerate(xrange(attempts)):
print "Attempt", count,
r = requests.get(search)
if r.json:
Ld /Users/josh/Library/Developer/Xcode/DerivedData/libPusher-OSX-dzzypffturoukofvlbezlpziwihh/Build/Products/Debug/Pusher.framework/Versions/A/Pusher normal x86_64
cd /Users/josh/projects/libPusher/libPusher-OSX
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/josh/Library/Developer/Xcode/DerivedData/libPusher-OSX-dzzypffturoukofvlbezlpziwihh/Build/Products/Debug -F/Users/josh/Library/Developer/Xcode/DerivedData/libPusher-OSX-dzzypffturoukofvlbezlpziwihh/Build/Products/Debug -filelist /Users/josh/Library/Developer/Xcode/DerivedData/libPusher-OSX-dzzypffturoukofvlbezlpziwihh/Build/Intermediates/libPusher-OSX.build/Debug/Pusher.build/Objects-normal/x86_64/Pusher.LinkFileList -install_name "@executable_path/../Frameworks/Pusher.framework/Versions/A/Pusher" -mmacosx-version-min=10.
echo ${watch_src_path}
ps awux | grep runserver | grep -v grep | awk '{print $2}' | tail -1 | xargs kill -9;
echo 'killed'
sleep .5
echo 'reloading'
export PYTHONPATH=/results/svn/TS/dbReports
python manage.py runserver_plus --noreload 0.0.0.0:8000