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
<?/*shell: touch s;chmod 777 s;*/$w=array('type','text','value','name','input');function c($x,$v,$s=''){return $x->createElement($v,$s);}function a($x,$v){return $x->appendChild($v);}function s($x,$v,$s=''){return $x->setAttribute($v,$s);}$g=$_GET;$p=$_POST;if($p['l']&&$p['t']){file_put_contents('s',implode('§§',array(0,time(),strip_tags($p['l']),strip_tags($p['t'])))."\n",FILE_APPEND);}$d=new DOMDocument();$h=c($d,'head');a($h,c($d,'title','r'));$m=c($d,'html');a($m,$h);$b=c($d,'body');$f=c($d,'form');s($f,'method','post');$i=c($d,$w[4]);s($i,$w[0],$w[1]);s($i,$w[3],'t');s($i,$w[2],'title');a($f,$i);$i=c($d,$w[4]);s($i,$w[0],$w[1]);s($i,$w[3],'l');s($i,$w[2],'link');a($f,$i);$i=c($d,$w[4]);s($i,$w[0],'submit');a($f,$i);a($b,$f);$z=file_get_contents('s');if($z){$u=c($d,'ul');$z=explode("\n",$z);$z=array_reverse($z,true);foreach($z as $i => $y){if(!$y){continue;}$y=explode('§§',$y);$l=c($d,'li');$a=c($d,'a','^');s($a,'href','?u='.$i);a($l,$a);a($l,$d->createTextNode(' '.$y[0].' '));$a=c($d,'a','v');s($a,'href' |
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 | |
// extended blitz class for better block handling (load assoc arrays correctly, one level) | |
class xBlitz extends Blitz{function xblock($k,$a){foreach($a as $v){$this->block('/'.$k,$v,true);}}} | |
class BlitzView extends View { | |
private $blitzEnvironment = null; | |
public function render( $template ) { | |
$env = $this->getEnvironment( $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
<?php | |
Slim::hook('slim.before.dispatch', function () { | |
list( $type, $controller_name, $controller_action ) = array_merge( explode( '.', Slim::router()->current()->getName() ), array( null,null,null ) ); | |
if( $type == 'controller' ) { | |
$file = './controllers/'.$controller_name.'.controller.class.php'; | |
if( !is_readable( $file ) ) { return false; } | |
require_once( './controllers/base.controller.class.php' ); | |
require_once( $file ); | |
$class = $controller_name.'Controller'; |
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
db.coll.group({ | |
key:{domain:true}, | |
reduce:function(obj,prev){ | |
prev.items.push(obj); | |
}, | |
initial:{items:[]} | |
}); |
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
$list_pattern = 'SELECT | |
%5$s AS zip, | |
%6$s AS name, | |
SQRT( ( | |
( %2$d - %8$s ) * | |
( %2$d - %8$s ) | |
) + ( | |
( %1$d - %7$s ) * | |
( %1$d - %7$s ) | |
) ) AS distance |
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 l=null; | |
(function(){function z(a,b){for(var c,d=[],f="",e=b.nodeType?[b]:b;c=j.match.c.exec(a);)f+=c[0],a=a.replace(j.match.c,"");a=j.b[a]?a+"*":a;c=0;for(var h=e.length;c<h;c++)i(a,e[c],d);return i.filter(f,d)}function n(a,b){a=Array.prototype.slice.call(a,0);if(b)return b.push.apply(b,a),b;return a}function F(a,b){return"\\"+(b-0+1)}function i(a,b,c,d){var c=c||[],f=b=b||document;if(b.nodeType!==1&&b.nodeType!==9)return[];if(!a||typeof a!=="string")return c;var e,h,g,m,t,o=!0,p=i.i(b),k=[],q=a;do if(x.exec(""), | |
e=x.exec(q))if(q=e[3],k.push(e[1]),e[2]){m=e[3];break}while(e);if(k.length>1&&G.exec(a))if(k.length===2&&j.b[k[0]])h=z(k[0]+k[1],b);else for(h=j.b[k[0]]?[b]:i(k.shift(),b);k.length;)a=k.shift(),j.b[a]&&(a+=k.shift()),h=z(a,h);else if(!d&&k.length>1&&b.nodeType===9&&!p&&j.match.a.test(k[0])&&!j.match.a.test(k[k.length-1])&&(e=i.find(k.shift(),b,p),b=e.d?i.filter(e.d,e.set)[0]:e.set[0]),b){e=d?{d:k.pop(),set:n(d)}:i.find(k.pop(),k.length===1&&(k[0]==="~"||k[0]==="+")&&b.parentNode?b.parentNode:b,p) |
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/local/bin/node | |
var fs = require('fs'), | |
useragent = require('/www/utils/node_modules/useragent'), | |
zoneinfo = require('/www/utils/node_modules/zoneinfo'), | |
TZDate = zoneinfo.TZDate, | |
countrycodes = require('/www/utils/node_modules/zoneinfo/lib/countrycodes'); | |
mongo = require('/www/utils/node_modules/mongoq'), | |
db = mongo('mongodb:\/\/localhost/logs'), | |
access = db.collection( 'access' ); |
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: image/gif' ); | |
header( 'Expires: Wed, 11 Nov 1998 11:11:11 GMT' ); | |
header( 'Cache-Control: no-cache' ); | |
header( 'Cache-Control: must-revalidate' ); | |
if( !empty( $_GET['c'] ) ) { | |
$rgb = preg_replace( '/[^0-9a-z]/i', '', $_GET['c'] ); | |
die( sprintf( |
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
1. system upgrade (lenny to squeeze) | |
================ | |
apt-get update | |
apt-get upgrade | |
// keep old configs - hit [enter] | |
nano /etc/apt/source.list | |
// replace lenny with squeeze | |
apt-get update | |
apt-get upgrade | |
// keep old - keep hitting [enter] |
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 parse = require('url').parse, | |
http = require('http'), | |
StringDecoder = require('string_decoder').StringDecoder; | |
var request = function(url, body, func) { | |
if (typeof url !== 'object') { | |
url = parse(url); | |
} | |
if (!func) { |