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 / beard.py
Created November 14, 2011 00:09
BeardDetector using SimpleCV
import SimpleCV
import time
c = SimpleCV.Camera(1)
js = SimpleCV.JpegStreamer()
while(1):
img = c.getImage()
img = img.smooth()
img = img.dilate()
@gourneau
gourneau / gist:1415698
Created December 1, 2011 10:37
PHP List Directories by Date
<?php
//This little PHP script is the most elegant way
//I could find the list directories and
//files with PHP and sort by date
//thanks to StackOverflow
$files = array();
$dir = new DirectoryIterator('.');
foreach ($dir as $fileinfo) {
@gourneau
gourneau / downloadChunks.py
Created December 4, 2011 18:33
Download large files with Python urllib2 to a temp directory
import os
import urllib2
import math
def downloadChunks(url):
"""Helper to download large files
the only arg is a url
this file will go to a temp directory
the file will also be downloaded
in chunks and print out how much remains
@gourneau
gourneau / gist:2003796
Created March 8, 2012 22:13
tastypie simplest possible non orm resource
class Update(Resource):
def override_urls(self):
urls = [url(r"^(?P<resource_name>%s)%s$" % (self._meta.resource_name, trailing_slash()),
self.wrap_view('dispatch_update'), name="api_dispatch_update")
]
return urls
def dispatch_update(self, request, **kwargs):
@gourneau
gourneau / hos.js
Created April 18, 2012 09:14
hearts of space list
var request = require('request')
var jsdom = require('jsdom')
var _ = require('underscore.string')
request({ uri:'http://www.hos.com/php/printProgram2.php?program=0927' }, function (error, response, body) {
if (error) {
console.log('Error downloading page')
process.exit(1)
}
@gourneau
gourneau / gist:2885082
Created June 6, 2012 21:56 — forked from jeserkin/gist:1953801
Twitter Bootstrap Fluid-Sticky example. Modified martinbean example.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="../assets/css/bootstrap.css" rel="stylesheet">
<style type="text/css">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet">
<style type="text/css">
@gourneau
gourneau / hos.js
Created June 7, 2012 21:32
hos domrip
var request = require('request')
var jsdom = require('jsdom')
var _ = require('underscore.string')
request({ uri:'http://www.hos.com/php/printProgram2.php?program=0927' }, function (error, response, body) {
if (error) {
console.log('Error downloading page')
process.exit(1)
}
@gourneau
gourneau / gist:3019988
Created June 29, 2012 19:02
Python Objective C keylogger
"""PyObjC keylogger for Python
by ljos https://github.com/ljos
"""
from Cocoa import *
from Foundation import *
from PyObjCTools import AppHelper
class AppDelegate(NSObject):
def applicationDidFinishLaunching_(self, aNotification):
@gourneau
gourneau / jquery.activity-indicator-1.0.0.min.js
Created July 6, 2012 18:33
jquery.activity-indicator-1.0.0.min.js
/*!
* NETEYE Activity Indicator jQuery Plugin
*
* Copyright (c) 2010 NETEYE GmbH
* Licensed under the MIT license
*
* Author: Felix Gnass [fgnass at neteye dot de]
* Version: @{VERSION}
*/