This file contains hidden or 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
/* | |
* Method: email_rfc | |
* Validate email, RFC compliant version | |
* | |
* Originally by Cal Henderson, modified to fit Kohana syntax standards: | |
* - http://www.iamcal.com/publish/articles/php/parsing_email/ | |
* - http://www.w3.org/Protocols/rfc822/ | |
* | |
* Parameters: | |
* email - email address |
This file contains hidden or 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
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6L/Y30hj/CJ/WehbUuSrTb9qTFkX/uHya8copfyg4T0+VexzGhZV7dp5VZISVnk8B0N4ZOlBp5y15pRKR9OIK1q2JjMq5uyGRIkiF62kkvo8PQ/OpMBk/glV0WJ73AZdgYV9HRS8Zr/cnPsw2Lp4hjrMwvj9Tv+Q5l+dl3HQ7O3xfIAdxSe2y62Sn/tg3vp+d6tEtEz8HFc0+YoCbRnhAuXA9R8sEW3nuyLXnITGSZ6SEHcPBkqtEqdshXHRbg8cTu5TenA9jfbyIsF2+hc/kYnek8YUzscUXGYjjg5ItRsoVtBTKf51KPx23ZJGX7VGTmVPsFfC8byj/De2S2GjUw== soldair@host |
This file contains hidden or 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
// walkdir ~0.0.5 | |
var fs = require('fs') | |
, walkdir = require('../walkdir') | |
// write all logs to the logs.cat file | |
, ws = fs.createWriteStream('logs.cat') | |
; | |
var em = walkdir('./'); | |
em.on('file',function(path,stat){ |
This file contains hidden or 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
cat /etc/passwd | node -e "var buf ='',rev=function(lines){lines.forEach(function(l,k){process.stdout.write(l.split('').reverse().join('')+'\n')})};process.stdin.on('data',function(b){buf+=b.toString();b = buf.split('\n');buf = b.shift();rev(b)}); process.stdin.resume();" |
This file contains hidden or 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
/* | |
* nodejs style require for php | |
* */ | |
function _require($file){ | |
static $requireCache = array(); | |
if(isset($requireCache[$file])) return $requireCache[$file]; | |
//todo support namespaces? evil eval? copy the file... all sad solutions | |
$module = array(); | |
$module['exports'] = array(); |
This file contains hidden or 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 | |
function _strtotime_us2($str,$now=null) { | |
if ($now === null) { | |
$now = time(); | |
} | |
$strp = explode('-',$str); |
This file contains hidden or 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
if [ "node-v0.5.10" !-d ]; then | |
curl http://nodejs.org/dist/v0.5.10/node-v0.5.10.tar.gz | |
tar -xvf node-v0.5.10.tar.gz | |
fi | |
cd node-v0.5.10 | |
./configure | |
if [ $? != 0 ]; then | |
echo "configure failed =(" | |
exit 1; |
This file contains hidden or 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
//is not array object | |
var isObject = function(o){ | |
return new Object(o) === o && !(o instanceof Array) | |
} |
This file contains hidden or 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 cpy = function(a){return Array.prototype.slice.call(a)} | |
,appendTo = function(b,a){var c = cpy(b);c.unshift(a.length,0);a.splice.apply(a,c);return a} | |
,appendToCopy = function(b,a){return appendTo(b,cpy(a))} | |
module.exports = {copy:cpy,appendTo:appendTo,appendToCopy:appendToCopy}; |
This file contains hidden or 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 | |
/* | |
~>php bench.php | |
md5_file 634.3932 ms | |
hash_file/md5 714.4802 ms | |
parse contents 911.6130 ms | |
parse contents substr 852.8361 ms | |
contents first chunk 590.0660 ms | |
all ran with 30000 itterations |