Skip to content

Instantly share code, notes, and snippets.

View gourneau's full-sized avatar
🎯
Focusing

Joshua Gourneau gourneau

🎯
Focusing
View GitHub Profile
@gourneau
gourneau / httpserver
Created August 27, 2012 07:36
ARTHttp
//a ugly http server, the worst ever made
// Learning Processing
// Daniel Shiffman
// http://www.learningprocessing.com
// Example 19-1: Simple therapy server
// Import the net libraries
import processing.net.*;
@gourneau
gourneau / fabfile..py
Created August 27, 2012 21:43
fab delpy
from __future__ import with_statement
from fabric.api import local, settings, abort, run, cd, put, env, lcd
from fabric.operations import local
from fabric.contrib.console import confirm
import os
env.hosts = ['root@IP']
env.passwords = {'root@IP': 'PASSWORD'}
@gourneau
gourneau / local_urls.py
Created October 16, 2012 20:48
local_urls.py
# Copyright (C) 2010 Ion Torrent Systems, Inc. All Rights Reserved
from django.conf import settings
from django.conf.urls.defaults import *
from django.http import HttpResponsePermanentRedirect
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
#admin.site.login_template = "rundb/login.html"
@gourneau
gourneau / local_settings.py
Created October 16, 2012 20:49
local_settings.py
# Local settings for dev work
import os.path as path
TEST_INSTALL = True
DEBUG = True
## NOTE: Without this, uses system installed postgres database, shared between instances.
#DATABASES = {
@gourneau
gourneau / reload.sh
Created October 16, 2012 21:43
reload
export PYTHONPATH=/results/svn/TS/dbReports
python manage.py runserver_plus --noreload 0.0.0.0:8000&
watchmedo shell-command \
--patterns="*.py;*.html" \
--recursive \
--command="./kill.sh" \
.
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
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.
@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:
@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 / 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