Skip to content

Instantly share code, notes, and snippets.

View ronanguilloux's full-sized avatar

Ronan Guilloux ronanguilloux

View GitHub Profile
@joemccann
joemccann / nginx + node setup.md
Created October 25, 2010 02:06
Set up nginx as a reverse proxy to node.js.

The idea is to have nginx installed and node installed. I will extend this gist to include how to install those as well, but at the moment, the following assumes you have nginx 0.7.62 and node 0.2.3 installed on a Linux distro (I used Ubuntu).

In a nutshell,

  1. nginx is used to serve static files (css, js, images, etc.)
  2. node serves all the "dynamic" stuff.

So for example, www.foo.com request comes and your css, js, and images get served thru nginx while everything else (the request for say index.html or "/") gets served through node.

  1. nginx listens on port 80.
@ekampf
ekampf / gist:772597
Created January 10, 2011 09:56
Show the current Git branch in the command line prompt
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOUR="\[\033[0m\]"
PS1="$GREEN\u@machine$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ "
@easel
easel / vagrant.org
Created January 18, 2011 17:11 — forked from zellyn/vagrant.org
@chrisjacob
chrisjacob / README.md
Created February 18, 2011 03:44
Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

@ornicar
ornicar / .vimrc
Created April 1, 2011 21:01 — forked from marcw/.vimrc
" Insert current namespace and opens php and create empty class, based on the file name
nmap <F9> ggO<?php<CR><CR><ESC>"%PdF/r;:s#/#\\#g<CR>Inamespace <ESC>d/[A-Z]<CR>Goclass <C-R>=expand("%:t:r")<CR><CR>{<CR>
@sbecker
sbecker / vagrant.txt
Created June 27, 2011 21:17 — forked from easel/vagrant.org
Installing CentOS 5.5 & Puppet on Vagrant
# -*- coding: utf-8 -*-
* Installing CentOS 5.5 & Puppet
** Notes
** Download install iso: http://mirrors.kernel.org/centos/5.5/isos/x86_64/CentOS-5.5-x86_64-bin-DVD-1of2.iso
** Create a new VirtualBox machine
- Name: vagrant-centos
- Operating System: Linux
@OiNutter
OiNutter / encapsulation.js
Created August 26, 2011 11:26
OiNutter.co.uk - tipBox - JS Encapuslation
var toolTip = function(){
var _privateProp = 'foo',
_privateMethod = function(){
return 'bar';
},
publicMethod = function(){
return _privateProp + _privateMethod();
};
return {
@pjkix
pjkix / css-stats-ack.sh
Created October 5, 2011 21:39
shell script to generate some css file statistics
#!/bin/bash
## v1.0.6
## this script will gernerate css stats
### example output
# CSS STATS
# ----------
# Floats: 132
@tj
tj / routes.js
Created October 15, 2011 00:23
Express routes
var app = require('../app');
console.log();
app.routes.all().forEach(function(route){
console.log(' \033[90m%s \033[36m%s\033[0m', route.method.toUpperCase(), route.path);
});
console.log();
process.exit();
// modified from code of "JQuerify" bookmarklet
// http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet
(function() {
function z(a, b) {
var c = document.createElement("script");
c.src = a;
var d = document.getElementsByTagName("head")[0], e = !1;
c.onload = c.onreadystatechange = function() {
!e && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") && (e = !0, b(), c.onload = c.onreadystatechange = null, d.removeChild(c));
};