A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
- Headers
- Links
- Bold
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
#!/usr/bin/env php | |
<?php | |
$app = function($request) { | |
$body = <<<EOS | |
<!DOCTYPE html> | |
<html> | |
<meta charset=utf-8> | |
<title>Hello World!</title> |
<?checkdnsrr(join('.',array_reverse(explode('.',$p=getenv('REMOTE_ADDR')))).".opm.tornevall.org","A")&&die('Bad Bot');mysql_connect(0,'root','');mysql_select_db('d');extract($_REQUEST);$v=(int)@$v;$i=0;$q='mysql_query';$f='mysql_fetch_row';$n='mysql_num_rows';$x='<input type="';$s="SELECT*FROM";$t='CREATE TABLE IF NOT EXISTS t(i INT AUTO_INCREMENT,a INT,b TEXT,KEY(i))';$h='htmlspecialchars';$q($t);$q(strtr($t,'t','p'));$l=' ORDER BY';$o='';$u='INSERT INTO';$c="b)VALUES(";if(@$b){if(!$v)$q("$u t(a,$c INET_ATON('$p'),'$e')");$v=max($v,mysql_insert_id());$q("$u p(a,$c'$v','$b')");}if($v){$t=$q("$s p WHERE a=$v$l i");echo'<a href="f.php">Back</a>';for(;$i<$n($t);++$i){$r=$f($t);echo'<hr/>'.nl2br($h($r[2]));}}else{$t=$q("$s t$l-i");for(;$i<$n($t);++$i){$r=$f($t);echo'<a href="f.php?v='.$r[0].'">'.$h($r[2]).'</a><br/>';}$o='Title:'.$x.'text"name="e"/><br/>';}echo'<hr/>Post:<form method="post">'.$x.'hidden"name="v"value="'."$v\"/>$o<textarea name=\"b\"></textarea>$x";?>submit"name="w"value="Post"/></form> |
<IfModule mod_rewrite.c> | |
Options -MultiViews | |
RewriteEngine On | |
#RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f [OR] | |
RewriteCond %{REQUEST_FILENAME} \.(js|css)$ | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . subfolder.php [L] | |
</IfModule> |
A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
// the api for accessing the site | |
var api = (function ($) { | |
var self = {}; | |
// the prefix for api requests | |
self.prefix = '/myapi/v1/'; | |
// enable/disable debugging output to the console | |
self.debug = false; | |
var app = (function ($) { | |
var self = {}; | |
// change pages via app.go('/new/page') or app.go(-1) | |
self.go = function (url) { | |
if (url === parseInt (url)) { | |
History.go (url); | |
} else { | |
History.pushState (null, null, url); | |
} |
Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
FROM ubuntu:13.04 | |
MAINTAINER Johnny Broadway "[email protected]" | |
RUN apt-get update | |
RUN apt-get install -y wget git vim postfix nginx sqlite | |
RUN apt-get install -y mysql-server mysql-client | |
RUN apt-get install -y php5-cli php5-common php5-mysql php5-sqlite php5-curl php5-fpm | |
RUN wget -O /etc/nginx/sites-available/default https://gist.github.com/jbroadway/6369183/raw/682a1ed8078cc39f59c3624f460b128addff95db/nginx-default |
This project has been moved to: | |
https://github.com/jbroadway/au |