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
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
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
<?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
//... | |
$("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 | |
// 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
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
// In global scope | |
ANDREW = $.extend(window.ANDREW||{}, { | |
someVar : 1, | |
someOtherVar : false, | |
someFunc : function(params) {}, | |
someOtherFunc : function(params) {}, | |
}); | |
// ... 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
<?php | |
// For the following sequence, the correct answer is set '79778' produces product '24696' | |
$numbers = <<<EOD | |
73167176531330624919225119674426574742355349194934969835203127745063262395783180169848018694788518438586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557668966489504452445231617318564030987111217223831136222989342338030813533627661428280644448664523874930358907296290491560440772390713810515859307960866701724271218839987979087922749219016997208880937766572733300105336788122023542180975125454059475224352584907711670556013604839586446706324415722155397536978179778461740649551492908625693219784686224828397224137565705605749026140797296865241453510047482166370484403199890008895243450658541227588666881164271714799244429282308634656748139191231628245861786645835912456652947654568284891288314260769004224219022671055626321111109370544217506941658960408071984038509624554443629812309878799272442849091888458015616609791913387549920052406368991256071760605886116 |
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 | |
$str; | |
while(true) { | |
if (preg_match('/^(.{1,60})( |$)/', $str, $match)) { | |
print $match[1]; | |
$str = substr($str, strlen($match[1])); | |
} | |
else { |