Skip to content

Instantly share code, notes, and snippets.

View namlet's full-sized avatar

Nathan Loyer namlet

View GitHub Profile
@namlet
namlet / Box Coordinates
Created February 9, 2011 23:37
Maintain selection coordinates using a closure. This example using jQuery.
var boxCoord = function(endCoord) {
var coord = endCoord;
return function(anotherCoord) {
return [anotherCoord, coord];
}
}
$('body').mousedown(function(e){
var thate = e;
$(this).mouseup(function(e){
set nocompatible
syntax on
filetype plugin indent on
set tabstop=4
set shiftwidth=4
set expandtab
set number
set sts=4
set smarttab
set autoindent
alias savehistory="history | cut -c7- >> ~/history.save; sort -u ~/history.save >> ~/history.save.tmp; rm ~/history.save; mv ~/history.save.tmp ~/history.save"
alias remember="cat ~/history.save | grep"
namlet@odin:~$ ssh -vvv -A fapestniegd.xen.prgmr.com
OpenSSH_5.1p1 Debian-5, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to fapestniegd.xen.prgmr.com [173.245.73.171] port 22.
debug1: Connection established.
debug1: identity file /home/namlet/.ssh/identity type -1
debug1: identity file /home/namlet/.ssh/id_rsa type -1
debug1: identity file /home/namlet/.ssh/id_dsa type -1
@namlet
namlet / gist:638577
Created October 21, 2010 14:27
Fix to ApiServlet Class in Shindig PHP Port. Should honor Accept header before Content-Type.
if (isset($_SERVER['HTTP_ACCEPT'])) {
// normalize things like "application/json; charset=utf-8" to application/json
foreach ($acceptedContentTypes as $contentType) {
if (strpos(strtolower($_SERVER['HTTP_ACCEPT']), $contentType) !== false) {
$_SERVER['HTTP_ACCEPT'] = $contentType;
$this->setContentType($contentType);
break;
}
}
}
brahma:shindig nathanloyer$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: content/sampledata/canonicaldb.json
#
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add/rm <file>..." as appropriate to mark resolution)
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
#user nobody;
worker_processes 1;
error_log /opt/local/var/log/nginx/error.log;
pid /opt/local/var/run/nginx.pid;
events {
worker_connections 1024;
}
#!/bin/bash
## ABSOLUTE path to the PHP binary
PHPFCGI="/opt/local/bin/php-cgi"
## tcp-port to bind on
FCGIPORT="9000"
## IP to bind on
FCGIADDR="127.0.0.1"