Skip to content

Instantly share code, notes, and snippets.

View joaoffcosta's full-sized avatar

João Costa joaoffcosta

View GitHub Profile
@tarla
tarla / .gitconfig
Created February 5, 2016 14:56
Git Configuration
[user]
name = $NAME
email = $EMAIL
[alias]
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all --enable=receive-pack ./.git
hist = !git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
[push]
default = simple
@ryanflorence
ryanflorence / static_server.js
Last active April 26, 2024 16:18
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);