##Given Apache 2 and MySQL are already installed.
#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated
#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules
var TemplateEngine = function(html, options) { | |
var re = /<%([^%>]+)?%>/g, | |
reExp = /(^( )?(if|for|else|switch|case|break|{|}))(.*)?/g, | |
code = 'var r=[];\n', | |
cursor = 0, | |
add = function(line, js) { | |
js? (code += line.match(reExp) ? line + '\n' : 'r.push(' + line + ');\n') : | |
(code += line != '' ? 'r.push("' + line.replace(/"/g, '\\"') + '");\n' : ''); | |
return add; | |
}; |
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs"), | |
port = process.argv[2] || 3000, | |
mimeTypes = { | |
'asc' : 'text/plain', | |
'au' : 'audio/basic', | |
'avi' : 'video/x-msvideo', |
##Given Apache 2 and MySQL are already installed.
#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated
#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules
<?php | |
/** | |
* A Compatibility library with PHP 5.5's simplified password hashing API. | |
* | |
* @author Anthony Ferrara <ircmaxell@php.net> | |
* @license http://www.opensource.org/licenses/mit-license.html MIT License | |
* @copyright 2012 The Authors | |
*/ | |
if (!defined('PASSWORD_DEFAULT')) { |
chown -R www-data:www-data /var/www | |
chown -R www-data:www-data /usr/share/nginx/html |
;(function(ls, ss){ | |
var fallback = {setItem:function(){}, getItem:function(){ return null;}, removeItem:function(){}}, | |
ls = ls || fallback}, | |
ss = ss || fallback, | |
JSON = JSON || {stringify:function(){},parse:function(){}}; | |
window.Store = { | |
"set": function(key, value) { |