Skip to content

Instantly share code, notes, and snippets.

View benjisg's full-sized avatar

Benji Schwartz-Gilbert benjisg

  • Airbnb Inc.
  • Seattle, WA
View GitHub Profile
@benjisg
benjisg / echo_server.go
Last active September 11, 2024 03:11
Simple GO HTTP server to pretty print the request body sent to it
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
@benjisg
benjisg / gist:866343
Created March 11, 2011 18:38
JavaScript Module Pattern
// Setup a module and use immediate invocation to run it right away
var MyModule = function() {
// Some private properties
var foo = "1";
var bar = 2;
// A private function
var updateFoo = function(value) {
foo = value;