Skip to content

Instantly share code, notes, and snippets.

View jhuttner's full-sized avatar

Joseph Huttner jhuttner

View GitHub Profile
@jhuttner
jhuttner / gist:1619424
Created January 16, 2012 06:37
alerter.js
function alerter(start, finish) {
for (var i=0; i<=5; i++) {
setTimeout(function() {
alert(i);
}, i*1000)
}
}
@jhuttner
jhuttner / gist:1627527
Created January 17, 2012 17:08
code-boss-proposal-config.json
[
{
"uid": "jhuttner",
"owner": "jhuttner",
"directories": ["/usr/local/adnxs"]
},
{
"uid": "jhuttner-personal",
"owner": "jhuttner",
"directories": ["/home/jhuttner/git-repos"]
function getName(callback) {
client.select('name from people', function(err, result) {
if (err) {
callback(err);
return;
} else {
// process result
}
});
}
def inside_circle(p1, p2):
# Return true if p1,p2 is contained within the unit cirle
return 0.5 > (((0.5 - p1) ** 2 + (0.5 - p2) ** 2) ** 0.5)
def appx_pi():
inside = 0
total = 0
while True:
p1 = random.random()
@jhuttner
jhuttner / appathon-ideas.txt
Created March 13, 2012 15:33
Appathon Ideas
# Use GitHub in some way
# Use MongoDB in same way
# Use Git in some way
# Use EC2 in some way
# Use Rackspace in some way.
# Idea - hosting platform for apps.
# Idea - create and push an app in ten minutes. Like, make an app really quickly.
Like, what if you included a PHP file (lib.php) and could start making calls immediately. So we don't just provide library code => we actually provide the compute.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"
<html>
<body>
<h1>hello, david</h1>
</body>
</html>
{"foo":"bar"}
#!./svn-branch-export.pl make
# this line tells emacs to highlight the file as a -*-shell-script-*-
#
# This file defines variables used to make the history.
# Please confirm the values below before running the script.
#
#dump_file "" # dump read from standard input
# Used to display better progress information:
@jhuttner
jhuttner / git-dropbox.py
Created June 5, 2012 22:49
Easily create Dropbox remotes for your Git repositories.
#!/usr/bin/env python
import getpass
import os
import subprocess
import sys
###############################################################################
#
@jhuttner
jhuttner / tag test
Created June 30, 2012 17:53
Refs are the same.
The refs for tags are the same.
01:tagtest(master) jhuttner$ git remote -v
origin git@github.com:jhuttner/tagtest.git (fetch)
origin git@github.com:jhuttner/tagtest.git (push)
01:tagtest(master) jhuttner$ git ls-files
foo.txt
01:tagtest(master) jhuttner$ echo "barbar" >> foo.txt
01:tagtest(master) jhuttner$ git add foo.txt
01:tagtest(master) jhuttner$ git commit -m "Add barbar line."