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
#!/usr/bin/perl | |
use strict; | |
# default php executable, version | |
my $PHPBIN= '/usr/bin/php'; | |
my $PHPVER= '5.2.10'; | |
my $PEARBIN= '/usr/bin/pear'; | |
my $MESSAGE= 'OK '; | |
use lib "/usr/lib/nagios/plugins"; |
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 | |
// .. bootstrap | |
Zend_Registry::set('identity', new Zend_Session_Namespace()); | |
// .. login | |
$result = $this->_auth->authenticate($adapter); | |
if ($result->isValid()) { | |
$ident = $this->_auth->getIdentity(); | |
$model = new Model_User; |
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 tspot = jQuery.extend(true, window.tspot || {}, { | |
log : function(message) { | |
(window.console && window.console.log) ? | |
window.console.log(message) : | |
alert(message); | |
}, | |
// page specific functions under their own ns | |
}); | |
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
// use tail -f /file/to/watch | node process_stdio.js to consume a stream | |
var partial = "", queue = []; | |
stdio = process.stdio; | |
stdio.open(); | |
// Grab whole lines off of stdio | |
stdio.addListener("data", function(chunk) { | |
if (chunk) { | |
if ("" != partial) { |
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 | |
/** | |
* Zend_Application, Zend_Loader, Zend_Loader_* and Zend_Exception require | |
* a 'hard coded' path. We've set up a special copy of the Zend Framework at: | |
* | |
* /usr/share/php/ZendFrameworkLoader/library | |
* | |
* This prevents the autoloader from confusingly loading the incorrect version | |
* of a given file. |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> | |
<html> | |
<head> | |
<title></title> | |
<script> | |
function foo(){ | |
alert(this.tagName || this.nodeName); | |
}; | |
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 { |
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
// In global scope | |
ANDREW = $.extend(window.ANDREW||{}, { | |
someVar : 1, | |
someOtherVar : false, | |
someFunc : function(params) {}, | |
someOtherFunc : function(params) {}, | |
}); | |
// ... Later |
OlderNewer