Skip to content

Instantly share code, notes, and snippets.

C major Completely pure. Its character is: innocence, simplicity, naïvety, children's talk.
Koji Kondo - Theme of Super Mario 64
Sega - Star Light Zone (Sonic The Hedgehog)
Sega - Green Hill Zone (...)
Pauer text: A pure, certain and decisive manner, full of innocence, earnestness, deepest religious feeling.
C minor Declaration of love and at the same time the lament of unhappy love. All languishing, longing, sighing of the love-sick soul lies in this key. "complaining"
Koji Kondo - Dark World (The Legend of Zelda - A Link to the Past)
Koji Kondo - Fortress (Super Mario World, chorus)
@rogerclark
rogerclark / doubleclick.js
Last active December 20, 2015 15:59
bind both click and dblclk on the same jQuery element (by simulating dblclk)
function clickAndDoubleClick(el, fnclick, fndblclk) {
var clicked = false;
var timeoutid;
// for IE7, use 'mouseup'
el.on('click', function() {
if (clicked) {
clicked = false;
clearTimeout(timeoutid);
fndblclk.apply(this, arguments);
} else {
@rogerclark
rogerclark / logify.js
Last active December 20, 2015 13:09
log method calls of an arbitrary JavaScript object
var Class = function() {
this.test = 'hi';
}
Class.prototype.testfunc = function(arg1, arg2) {
console.log(arg1 + arg2);
}
function logify(obj, name) {
var proto = Object.getPrototypeOf(obj);
@rogerclark
rogerclark / Place Multiple.jsx
Last active December 16, 2015 04:09
"File > Place" multiple files in Photoshop. The default dialog only allows you to select one file at a time.
function placeFile(file)
{
// this is horrid output from ScriptListener, but it gets the job done.
// the app.open() method will only turn PSD files into Smart Objects
var idPlc = charIDToTypeID( "Plc " );
var desc2 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
desc2.putPath( idnull, file);
var idFTcs = charIDToTypeID( "FTcs" );
var idQCSt = charIDToTypeID( "QCSt" );
@rogerclark
rogerclark / gist:376971
Created April 23, 2010 18:48
Slicehost Dynamic DNS script
<?
require_once("ActiveResource.php");
$recordname = $_GET["record"];
if ($recordname[strlen($recordname) - 1] != '.')
$recordname .= '.';
$ipaddr = $_GET["ip"];
if ($ipaddr == '')
$ipaddr = $_SERVER["REMOTE_ADDR"];