This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A RingBufffer | |
function RingBuffer(sz) { | |
this._max = sz; | |
this._buffer = new Array(sz); | |
this._head = -1; | |
} | |
RingBuffer.prototype = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 --- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var foo = "yes"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// assumes dojo base is loaded | |
(function(d) { | |
var spels = { | |
destroy: [ "destory" ], | |
connect: [ "conect"] | |
}; | |
for(var x in spels) { | |
d.forEach(spels[x], function(n) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/src/node (master) | |
> node | |
Type '.help' for options. | |
node> var puts = require("sys").puts; | |
node> puts(5*2) | |
10 | |
node> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function itWorked(response) { console.log("yay!"); } | |
function itFailed(err) { console.error("boo!", err); } | |
// in dojo 1.4+ | |
var theForm = dojo.byId("theForm"); // assumes <form id="theForm"> is what you want | |
var def = dojo.xhrPost({ | |
url: "/send/it/here", | |
rawBody: dojo.formToJson(theForm), |
OlderNewer