Skip to content

Instantly share code, notes, and snippets.

View walm's full-sized avatar

Andreas Wålm walm

  • Sweden
View GitHub Profile
@JalfResi
JalfResi / revprox.go
Last active June 18, 2024 18:29
Simple reverse proxy in Go
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@solenoid
solenoid / gist:1372386
Created November 17, 2011 04:49
javascript ObjectId generator
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
}).toLowerCase();
};
@jamesarosen
jamesarosen / 04_jshint.rake
Created May 2, 2011 23:41
Javascript Loves CI: Jenkins + Jasmine + PhantomJS + JSHint
namespace :jshint do
task :require do
sh "which jshint" do |ok, res|
fail 'Cannot find jshint on $PATH' unless ok
end
end
task :check => 'jshint:require' do
project_root = File.expand_path('../../', File.dirname(__FILE__))
config_file = File.join(project_root, 'config', 'jshint.json')