##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
/* | |
* LetterAvatar | |
* | |
* Create Letter avatar based on Initials - | |
* based on https://gist.github.com/leecrossley/6027780 | |
*/ | |
(function(w, d){ | |
function LetterAvatar (name, size) { |
<?php | |
function fuzzy_search($search, $text, $distance = 3){ | |
$needles = explode(' ', mb_strtolower($search, 'UTF-8')); | |
$tokens = explode(' ', mb_strtolower($text, 'UTF-8')); | |
$score = 0; | |
$levenshtein_utf8 = function ($s1, $s2) { | |
$map = []; |
/** | |
<style> | |
.var-test:before { | |
content: 'hello'; | |
} | |
</style> |
<?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')) { |
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; | |
}; |
/** | |
asyncexec(function(times){ | |
for (var x=0, y;x<times;x++) { | |
y = x/2; | |
} | |
release(x); | |
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
chown -R www-data:www-data /var/www | |
chown -R www-data:www-data /usr/share/nginx/html |