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 pollInterval = 1000; | |
var someFunc = function(){ | |
/* do some shit */ | |
window.setTimeout(someFunc, pollInterval); | |
}; | |
someFunc(); |
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 | |
// More info at http://framework.zend.com/manual/en/zend.db.adapter.html | |
// Assumes Zend dir is in your include path | |
require_once 'Zend/Db.php'; | |
$db = Zend_Db::factory('Pdo_Mysql', array( | |
'host' => '127.0.0.1', | |
'username' => 'webuser', |
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.edit").live("click", function(){ | |
$(this).prev(".cmrl").msgeditor({showPreview:true, buttons:{ | |
Accept: function(hash) { | |
// Update preview, show | |
$(hash.textarea).next(".preview").html(hash.preview).show(); | |
// Update CMRL, close editor |
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 | |
$xml = <<<EOD | |
<?xml version="1.0" encoding="UTF-8"?> | |
<cmrl xmlns:dotgo="http://dotgo.com/cmrl/1.0" account="jddbb-ztc2l-f1tb7-2c8st"> | |
<match pattern=""> | |
<message><content>DOTGO.COM<br /> | |
Welcome to DOTGO!<br /> | |
<br /> | |
Reply:<br /> |
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
window.PHONO = null; | |
$.phono({ | |
apiKey: "XXXXX", | |
onReady: function(){ | |
PHONO = this; | |
} | |
}); | |
$(function(){ |
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
TRUPH = jQuery.extend(true, TRUPH||{}, { | |
domain: "http://tru.ph", | |
basePath: "/photo", | |
getBaseUrl: function(){ | |
return TRUPH.domain+TRUPH.basePath; | |
}, | |
shebang: "#!" | |
}); | |
jQuery(function($){ |
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
# hurdur.php | |
<?php | |
function hurdur_render($_template, array $params=array()) { | |
if (isset($params['_template'])) { | |
trigger_error('_template is reserved'); | |
} | |
extract($params); | |
include $_template; |
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 pollInterval = 10000, | |
pollTimeout = null; | |
function pollSpots() { | |
printDXSpots(); | |
pollTimeout = window.setTimeout(pollSpots, pollInterval); | |
} | |
// ... later ... |
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
// This has only been tested on Chrome | |
// A message for Facebook: I'm just automating something any user could waste an afternoon doing... | |
// 1) Open up Chrome. | |
// 2) Navigate to a Facebook friend's photo gallery. | |
// 3) Right click (Control+click on Mac) anywhere on the page and select "Inspect Element". | |
// 4) In the debugger that pops up, click on the "Console" tab. | |
// 5) Copy and paste this code into the Console window and hit "Enter" on your keyboard. | |
// 6) The page will fill up with photos, this may take a couple of minutes. |
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 | |
header("Content-type: text/xml"); | |
if (empty($_POST) || !isset($_POST["sys_query"])) { | |
echo "<message><content>Invalid request. Try again.<br/>Reply:<br/><a query=\"crbspt loc\" /> Geocode (1 address)</content></message>"; | |
exit; | |
} | |
$address = preg_replace('/^(crbspt\s+loc|loc\s+|1\s+)/', '', trim(strtolower($_POST["sys_query"]))); |