Skip to content

Instantly share code, notes, and snippets.

View wm's full-sized avatar

Will Mernagh wm

View GitHub Profile
@wm
wm / tmux_bindings.md
Created December 16, 2015 03:51
my tmux setup
Key binding Action
M n next-window
M p previous-window
M j move down a pane
M k move up a pane
M h move left a pane
M-l move right a pane
M ↑ move the pane divide up (resize)
M ↓ move the pane divide down (resize)
@wm
wm / main.go
Created November 8, 2015 01:47
calling-vs-casting-4
package main
import (
"fmt"
"net/http"
)
func Rofl(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "ROFL")
}
@wm
wm / main.go
Created November 8, 2015 01:46
calling-vs-casting-3
package main
import (
"fmt"
"net/http"
)
func Yolo(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "YOLO")
}
@wm
wm / main.go
Created November 8, 2015 01:45
casting-vs-calling-2
package main
import (
"fmt"
"net/http"
)
type Lol struct{}
func (l *Lol) ServeHTTP(w http.ResponseWriter, r *http.Request) {
@wm
wm / 001.go
Created November 8, 2015 01:43
casting-vs-calling-1
http.Handle("/yolo2", http.HandlerFunc(Yolo))
@wm
wm / handle.go
Last active November 8, 2015 01:01
casting-vs-calling
http.Handle("/yolo2", http.HandlerFunc(Yolo))

Keybase proof

I hereby claim:

  • I am wm on github.
  • I am wmernagh (https://keybase.io/wmernagh) on keybase.
  • I have a public key whose fingerprint is E2C9 3136 5CC3 DA1C 9F5C 1A67 ED8C 249C 2A6A 260D

To claim this, I am signing this object:

@wm
wm / 0_README.md
Last active August 29, 2015 14:07
Extract uniq emails sorted by domain from file.

Extract uniq emails sorted by domain from file.

Note that we ignore emails of the form xxx@yyy.com, i.e. if it has a '<' we ignore it.

Usage

$ extract_emails.zsh file_with_emails.txt
example@example.com
ex@ex.com
@wm
wm / MavericksUpgrade.md
Last active December 26, 2015 07:49
Upgrade OSX to Mavericks (Xcode, brew, boxen etc.)

Upgrades

  1. Install Mavericks
  2. Upgrade Xcode via App Store
  3. Launch Xcode to accept terms and auto install components
  4. Run the following commands
  • $ xcode-select --install # install command line tools if you have not already
  • $ boxen
  • $ brew update
let g:zeus_prefix = ""
let g:bundle_prefix = ""
let g:fdoc_prefix = ""
" Toggle the rspec_command
function! ToggleRspecCommand(prefix_name, prefix)
if g:{a:prefix_name}_prefix != ""
let g:{a:prefix_name}_prefix = ""
else
let g:{a:prefix_name}_prefix = a:prefix . " "