Skip to content

Instantly share code, notes, and snippets.

View jmhobbs's full-sized avatar

John Hobbs jmhobbs

View GitHub Profile
@jmhobbs
jmhobbs / weight_chart.php
Created June 30, 2010 20:08
A bit I wrote to visualize my weight.
<?php
/*
Copyright (C) 2010 John Hobbs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@jmhobbs
jmhobbs / php-source-merge.py
Created August 3, 2010 21:51
Combine PHP Source Files Into THE MONOLITH
# -*- coding: utf-8 -*-
# This script is used to combine PHP source files together into one big glob.
# I wrote this so I could distribute a single file web application, but develop
# it in a sane fashion.
# Copyright (c) 2010, John M. Hobbs
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@jmhobbs
jmhobbs / lazer_bot.user.js
Created August 30, 2010 16:51
The original LazerCatz bot!
// ==UserScript==
// @name Lazer Bot
// @author jmhobbs
// @version 2.2
// @namespace http://www.lazercatzthegame.com/
// @description a bot for Lazer Catz
// @include http://www.lazercatzthegame.com/*
// ==/UserScript==
var current_target = null;
@jmhobbs
jmhobbs / node-unstable.rb
Created February 10, 2011 03:09
Homebrew Formula for Node Unstable Branch
require 'formula'
class NodeUnstable <Formula
url 'http://nodejs.org/dist/node-v0.3.8.tar.gz'
head 'git://github.com/ry/node.git'
homepage 'http://nodejs.org/'
md5 '9ed9b4ec2fd726d6e9c94eb3f7b82090'
# Stripping breaks dynamic loading
skip_clean :all
# -*- coding: utf-8 -*-
# Copyright (c) 2010 John Hobbs
#
# http://github.com/jmhobbs/googlecode-irc-bot
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# -*- coding: utf-8 -*-
# Copyright (c) 2010 John Hobbs
#
# http://github.com/jmhobbs/googlecode-irc-bot
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@jmhobbs
jmhobbs / daemon.py
Created April 13, 2011 05:09
Cooked version of Python daemon base script.
#!/usr/bin/env python
# Origin: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
# Cooked up a bit by @jmhobbs
import sys, os, time, errno, atexit
from signal import SIGTERM
class Daemon:
"""
@jmhobbs
jmhobbs / pptpd.sh
Created May 1, 2011 14:33
Ubuntu 11.04 AWS EC2 PPTPD Installer
#!/bin/bash
#
# This script will install and configure a PPTPD server on your Ubuntu box.
# I use this for a micro instance on Amazon EC2 as a quick, cheap (free!) VPN
#
# This script was tested with Natty Narwahl 11.04, ami-06ad526f
#
# Usage:
# wget https://gist.github.com/raw/950539/pptpd.sh
@jmhobbs
jmhobbs / particles.html
Created August 12, 2011 21:46
Simple JavaScript Particles
<html>
<head>
</head>
<body>
<canvas id="base" width="500" height="500" style="border: 1px solid #444; background: #000;"></canvas>
<script>
var elem = document.getElementById( 'base' );
var context = elem.getContext( '2d' );
var Sprite = function () {
@jmhobbs
jmhobbs / chunker.py
Created August 31, 2011 18:48 — forked from squarepegsys/chunker.py
Get Python list in chunks
#!/usr/bin/env python
import unittest
from itertools import cycle
## get a list in chunks
## if we run out of items in the list, start again from the beginning
class Chunker(object):