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) { |
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 P={};(function(q,u,e,r,y){q=/\+/g;u=/([^&=]+)=?([^&]*)/g;e=function(s){return decodeURIComponent(s.replace(q,' '));};r=window.location.search.substring(1);while(y=u.exec(r)){P[e(y[1])]=e(y[2]);}})(); |
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 | |
class pastebin { | |
private $folder = './pastebins'; | |
public $pastes = array(); | |
function __construct( $folder = false ) { | |
if( $folder ) { | |
$this->folder = $folder; | |
} | |
$this->folder = rtrim( $this->folder, '/' ); |
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 | |
class pastebin { | |
private $folder = './pastebins'; | |
public $pastes = array(); | |
public $count = 0; | |
function __construct( $folder = false ) { | |
if( $folder ) { | |
$this->folder = $folder; | |
} |
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
class mon { | |
public $mongoobj = null; | |
public $db; | |
function __construct( $db ) { | |
$this->db = $db; | |
return; | |
} | |
function con() { | |
if( $this->mongoobj === null ) { | |
$this->mongoobj = new Mongo(); |
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
function s2t(s){ | |
var u=[{n:'now',l:5},{n:'second',l:60,is:1},{n:'minute',l:3600,is:60},{n:'hour',l:86400,is:3600},{n:'yesterday',l:172800,po:true},{n:'tomorrow',l:172800,fo:true},{n:'day',l:604800,is:86400},{n:'week',l:2629743,is:604800},{n:'month',l:31556926,is:2629743},{n:'year',l:Infinity,is:31556926}], | |
l={'future_format':'%s %t','past_format':'%t %s','second':'second','seconds':'seconds','minute':'minute','minutes':'minutes','hour':'hour','hours':'hours','day':'day','days':'days','week':'week','weeks':'weeks','month':'month','months':'months','year':'year','years':'years','yesterday':'yesterday','tomorrow':'tomorrow','now':'justnow','ago':'ago','in':'in'}, | |
_=function(s,v){if(!isNaN(v)&&v!=1){s=s+'s';}log(l[s]);return l[s]||s;}, | |
m=s.match(/(\d{4,})(?:-(\d{1,2})(?:-(\d{1,2})(?:[T ](\d{1,2}):(\d{1,2})(?::(\d{1,2})(?:\.(\d+))?)?(?:(Z)|([+-])(\d{1,2})(?::(\d{1,2}))?)?)?)?)?/), | |
a=Date.UTC(m[1],parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5]),parseInt(m[6]),0), | |
d=new Date(),lt=d.getTime(),l |
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
///////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// HTML | |
<form action="" method="post" id="enter_number"> | |
<p>Enter your phone number:</p> | |
<p><input type="text" name="phone_number" id="phone_number" /></p> | |
<p><input type="submit" name="submit" value="Verify" /></p> | |
</form> | |
<div id="verify_code" style="display:none;"> |
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 http = require('http') | |
, parse = require('url').parse | |
, StringDecoder = require('string_decoder').StringDecoder; | |
var LIMIT = 10 * 1024; | |
var request = function(url, body, func) { | |
if (typeof url !== 'object') { | |
url = parse(url); | |
} |
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
TAFFY.extend( 'capped', function( i, runInsert, runRemove ) { | |
var c = this.getDBI().cap || false; | |
if( c && ( c < ( this.count() + 1 ) ) ) { | |
while( c < ( this.count() + 1 ) ) { | |
this.getDBI().remove( this.context().results[0].___id ); | |
this.context({ | |
run: null | |
}); | |
this.getDBI().removeCommit( runRemove ); | |
} |