Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View nickbauman's full-sized avatar
🎯
Focusing

Nick Bauman nickbauman

🎯
Focusing
View GitHub Profile
@nickbauman
nickbauman / hb_posgres
Created June 25, 2012 19:38
Problems with homebrew installing postgress
brew --config
HOMEBREW_VERSION: 0.9
HEAD: fc0b4b636a366db1d66db216db380d9c2a4c7a82
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.7.4
Kernel Architecture: x86_64
Xcode: 4.3.3, CLT 4.3.0.0.1.1249367152
GCC-4.0: N/A
@nickbauman
nickbauman / go_vs_clojure_habits.txt
Last active July 8, 2017 23:40
Go vs. Clojure: Habits of Thinking
The goal is to insert an integer into an ordered list-like thingy.
Here's Go.
// Given g
g := []int{1, 2, 3, 4}
// Insert 44 in the middle of it
append(g[:2], append([]int{44}, g[2:]...)...)
@ibdknox
ibdknox / server.sh
Created August 4, 2011 06:13
example daemon for lein processes
#!/bin/bash
name=webnoir
pidfile=/var/run/$name.pid
if [ -f "$pidfile" ]; then
pid=`cat $pidfile`
running=`ps p $pid |wc -l`
if [ $running -eq 1 ]; then
pid=
@lavalamp
lavalamp / The Three Go Landmines.markdown
Last active February 16, 2024 12:16
Golang landmines

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }