Skip to content

Instantly share code, notes, and snippets.

View jmhobbs's full-sized avatar

John Hobbs jmhobbs

View GitHub Profile
@jmhobbs
jmhobbs / points.coffee
Last active August 29, 2015 14:04
A Points Tracker for Hubot
# Description:
#
# A plugin to track points awarded for good jokes.
#
# Hubot takes transaction fees though.
#
#
# Dependencies:
# A Redis brain is recommended.
#
/* Line 539 */
INSERT INTO `sources` VALUES (1,1,'stuffpress',1,1,1,'2009-12-03 22:19:18','2000-01-01 01:00:00','');
1. Install PHP
2. Install Zend
3. Edit config (no db yet though)
4. WSOD
5. Debug = 1
6. Log exception (write permissions)
7. Mkdir protected/logs/
8. Database exception
9. Create DB, load SQL
10. Bounced me to storytlr.com
@jmhobbs
jmhobbs / Framework Init.sh
Created March 11, 2010 17:37
Git Quick Directory Structure
for i in $(find . -type d -empty); do touch $i/.gitignore; done
@jmhobbs
jmhobbs / Crontab for Dreamhost Storytlr
Created March 12, 2010 21:28
Example Storytlr Crontab
*/15 * * * * cd /home/jmhobbs/lifestream.velvetcache.org && /usr/local/php5/bin/php ./protected/tools/update.php
@jmhobbs
jmhobbs / bin2img.php
Created March 15, 2010 15:29
Bitwise Data Vizualization in PHP
<?php
// Data Vizualization in PHP
// This file will render a 1024x1024 PNG using the raw binary data from a file.
// 1's will be black, 0's will be white.
/*
Copyright (c) 2010 John Hobbs
Permission is hereby granted, free of charge, to any person obtaining a copy
@jmhobbs
jmhobbs / update.php
Created April 27, 2010 17:04
Storytlr No Cron Updater
<?php
header( 'Content-type: text/plain' );
ini_set( 'output_buffering', 'Off' );
error_reporting( E_ALL & ~E_NOTICE & ~E_WARNING );
ini_set( 'display_errors', 0 );
$argc = 2;
$argv = array( 'update.php', 'admin' );
@jmhobbs
jmhobbs / storytlr_requirements_check.php
Created May 7, 2010 17:18
Storytlr Requirements Check
<?php
class Check {
protected static $errors = 0;
protected static $include_found = true;
public static function no_errors () {
return true;//( 0 == self::$errors );
}
@jmhobbs
jmhobbs / mongo.todo.php
Created May 18, 2010 15:47
A Simple ToDo App Using PHP and MongoDB
#!/usr/bin/env php
<?php
error_reporting( E_ERROR | E_PARSE );
class ToDo {
protected $argv = array();
public function __construct ( $argv ) {
@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: