Skip to content

Instantly share code, notes, and snippets.

View blowery's full-sized avatar

Ben Lowery blowery

View GitHub Profile
@blowery
blowery / gist:9763982
Created March 25, 2014 15:17
keybase.md
### Keybase proof
I hereby claim:
* I am blowery on github.
* I am blowery (https://keybase.io/blowery) on keybase.
* I have a public key whose fingerprint is B84B 74DB 367C 9A6F 3D9E B9CE 23D1 BB96 8F7E F8E8
To claim this, I am signing this object:
@blowery
blowery / gist:9764189
Created March 25, 2014 15:27
to nelson
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1
hQEMA4UcjUeLLfWGAQf/egcOQpRZMA7xfHt80vVemTW+tO6ZO7Fp0fUV0S6sokSe
Ahp2AfkFjnq0MdnnJlYeb5kSIHJK3PzAVg5+FLizFbuyPSJf2GHB7Fq2QVZMjh2M
w4Z5X1DM3RvqXHlQz3/rIPXLNkgSFqhvcEIopinwf1pMdfpPFtuznuhnUJ7hAHSv
0VAiLlQQDbmY1nIbnitr513qtSCHwqfA09nNvkBxzEA+vqx93qRs0wakqWqsZLKq
G6qMIT/4IyuqA4o3fq+oGAMXkrGyDtgJn93sPdrPmkKxMOc406rGFtb3zglteYf4
vjJGOj9wJTzB0oMSJsoH+jfYYyTxReRUZ9JuvJtP29JNAf98zZ7tmhTu/7T/7b0q
uUTjSgV9ge7/YU7+e1TVz9U/oOAzzf6+u7uK7gEuIcPd0r8J/PMyFRq0ZEgyc33I
Verifying myself: My Bitcoin username is +blowery. https://onename.io/blowery
<?php
if (isset($_GET['errors'])) { error_reporting(E_ALL); } else { error_reporting(0); }
// Requires the Universal Feed Writer from http://www.phpclasses.org/browse/package/4427.html
include("FeedWriter.php");
define('FIREWALLED', true);
define('FIREWALL_ROOT', 'firewall/');
include(FIREWALL_ROOT.'config/db.php');
dojo.objectToQuery = function(/*Object*/ map){
// summary:
// takes a name/value mapping object and returns a string representing
// a URL-encoded version of that object.
// example:
// this object:
//
// | {
// | blah: "blah",
// | multi: [
// A RingBufffer
function RingBuffer(sz) {
this._max = sz;
this._buffer = new Array(sz);
this._head = -1;
}
RingBuffer.prototype = {
// dojo
dojo.xhrGet({
url: "/dragons",
load: function(data) { /*do something w/ the data */ },
handleAs: "json"
});
// jQuery
jQuery.get("/dragons", function(data, textStatus){
/*do something w/ the data */
dojo.require("dijit._Widget");
dojo.declare("FileUploader", dijit._Widget, {
ID_KEY : 'APC_UPLOAD_PROGRESS',
statusUrl : 'status.php',
pollDelay : 500, // in milliseconds
form : null, // HTML form element
status : null, // element where the upload status is displayed
#!/bin/bash
# --- Version history ---
# 0.5: just for me, it takes two processes and two filenames so I can
# track a pair of processes
# 0.4: added variable to store file path, and $2 for base file name
# added variable to store desired reporting interval
# 0.3: added $1 to send in process ID at run time.
# 0.2: switched to $SECONDS for the loop. works.
# 0.1: didn't work well at all.
# --- Version history ---
var foo = "yes";