Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| server { | |
| listen 80; | |
| server_name server.mydomain.net | |
| root /var/www/app/web; | |
| index index.php; | |
| location ~ \.php$ { | |
| fastcgi_pass 127.0.0.1:9000; | |
| fastcgi_index index.php; | |
| include fastcgi_params; |
| include $(GOROOT)/src/Make.inc | |
| PROTOFILES=$(wildcard *.proto) | |
| GOPROTOFILES=$(patsubst %.proto,%.pb.go,$(PROTOFILES)) | |
| TARG=protopackage | |
| GOFILES=\ | |
| $(GOPROTOFILES)\ | |
| CLEANFILES+=$(GOPROTOFILES) |
| location /resize { | |
| alias /tmp/nginx/resize; | |
| set $width 150; | |
| set $height 100; | |
| set $dimens ""; | |
| if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) { | |
| set $width $1; | |
| set $height $2; | |
| set $image_path $3; |
| #!/bin/bash | |
| # <troll>If you don't have bash, go get a real OS.</troll> | |
| curl -s "http://md5.noisette.ch/md5.php?hash=$(curl -s http://live.free.fr | gunzip | tail -n 36 | head -n 32 | grep '[a-f0-9]' -o | xargs echo -n | sed 's/ //g')" | grep '<string>' | sed 's/^.*\[CDATA\[\(.*\)\]\].*$/\1/' |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| SELECT author FROM author; | |
| | author | | |
| +-------------------+ | |
| | "(1,'john doe')" | | |
| +-------------------+ | |
| | "(2,'Edgar')" | | |
| +-------------------+ | |
| SELECT | |
| author.id, |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| -- PostgreSQL 9.2 beta (for the new JSON datatype) | |
| -- You can actually use an earlier version and a TEXT type too | |
| -- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8 | |
| -- Inspired by | |
| -- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html | |
| -- http://ssql-pgaustin.herokuapp.com/#1 | |
| -- JSON Types need to be mapped into corresponding PG types | |
| -- |
##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
| //addEventListener polyfill 1.0 / Eirik Backer / MIT Licence | |
| (function(win, doc){ | |
| if(win.addEventListener)return; //No need to polyfill | |
| function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}} | |
| function addEvent(on, fn, self){ | |
| return (self = this).attachEvent('on' + on, function(e){ | |
| var e = e || win.event; | |
| e.preventDefault = e.preventDefault || function(){e.returnValue = false} | |
| e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true} |