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
echo "array_key_exists(\"key\", \$array)" | sed 's/array_key_exists\s*(\s*\(["].*["]\)\s*,\s*\($[A-Za-z].*\)\s*)/isset(\2[\1])/' |
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 | |
/** | |
* simple ab tester | |
* @author James Marshall-Gunn <[email protected]> | |
*/ | |
/** | |
* | |
* Parse the basic colon delimited stuff here. | |
* All results in milliseconds. |
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
sudo -s | |
nginx=stable | |
add-apt-repository ppa:nginx/$nginx | |
apt-get update | |
apt-get install nginx | |
sudo apt-get install php5 php5-dev php5-suhosin | |
sudo apt-get install php-pear php5-cgi php5-cli php5-curl | |
sudo apt-get install php5-gd php5-imagick php5-mcrypt | |
sudo apt-get install php5-fpm php-apc php5-memcache php5-mysql | |
sudo service php5-fpm start |
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'); | |
var url = require('url'); | |
var director = require('director'); | |
var router = new director.http.Router(); | |
var db = require('mongoose'); | |
db.connect('mongodb://localhost/ecomm_database'); | |
router.get('/:eventId', function (eventId){ | |
this.res.end(eventId); | |
}); |
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
(sb-ext:save-lisp-and-die "my_binary" :executable t :toplevel 'main-program-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
/* lisp.c: high-speed LISP interpreter */ | |
/* | |
The storage required by this interpreter is 8 * 4 = 32 bytes times | |
the symbolic constant SIZE, which is 32 * 1,000,000 = | |
32 megabytes. To run this interpreter in small machines, | |
reduce the #define SIZE 1000000 below. | |
To compile, type | |
cc -O -olisp lisp.c |
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
lisp, | |
xml, | |
json, | |
curl, | |
sha256, | |
gzip, | |
0mq, | |
neural networks, | |
decision tree, | |
sqlite |
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 | |
urlencode ($html); | |
>>>>>>> javascript | |
document.write (unescape ('')) |
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 renderTemplate (template, args) { | |
return template.replace (/({{[^{}]*}})/g, | |
function (match) { | |
return args [match.substr(2, match.length-4)]; | |
}); | |
} | |
renderTemplate('<h1>{{name}}:{{total_coins}}</h1>', { | |
fbid: '3g23403j4999', | |
name: 'barry', | |
total_coins: 500 |
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 Memento(originalState) { | |
this.state = originalState; | |
this.stack = new Array(this.state); | |
this.stackIndex = 0; | |
} | |
Memento.prototype.undo = function () { | |
return this.stackIndex > 0 ? | |
this.state = this.stack[--this.stackIndex]: this.state; | |
}; | |
Memento.prototype.save = function (state) { |
OlderNewer