Skip to content

Instantly share code, notes, and snippets.

Joseph Huttner jhuttner

Block or report user

Report or block jhuttner

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View test.html
<!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>
View appathon-ideas.txt
# 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.
View appx_pi.py
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()
View gist:1635784
function getName(callback) {
client.select('name from people', function(err, result) {
if (err) {
callback(err);
return;
} else {
// process result
}
});
}
@jhuttner
jhuttner / gist:1627527
Created Jan 17, 2012
code-boss-proposal-config.json
View gist:1627527
[
{
"uid": "jhuttner",
"owner": "jhuttner",
"directories": ["/usr/local/adnxs"]
},
{
"uid": "jhuttner-personal",
"owner": "jhuttner",
"directories": ["/home/jhuttner/git-repos"]
View gist:1619424
function alerter(start, finish) {
for (var i=0; i<=5; i++) {
setTimeout(function() {
alert(i);
}, i*1000)
}
}
View gist:1444210
if (!items_by_name[name]) {
items_by_name[name] = [];
}
items_by_name[name].push(item);
// could we do something like this?
items_by_name[name].smart_push(item, [])
View eachWhile.js
var add_to_list = false;
var result = [];
$.each(checks, function(check) {
// don't go through all the logic if we know we are going to append it
if (add_to_list) {
return true;
}
if (check()) {
addToList = true;
View split_array.php
<?php
function splitArray($array) {
$array = $this->quoteArray($array);
$fields = array_keys($array);
$fields_with_ticks = array();
foreach($fields as $f) {
$fields_with_ticks[] = '`'.$f.'`';
}
$values = array_values($array);
You can’t perform that action at this time.