Skip to content

Instantly share code, notes, and snippets.

View joncalhoun's full-sized avatar
💻
Making Go Courses

Jon Calhoun joncalhoun

💻
Making Go Courses
View GitHub Profile
tests=($(ls spec/features))
for i in "${tests[@]}"; do
firstChar=${i:0:1}
if [[ $firstChar < "l" ]]
# Replace this w/ test running.
then echo "bundle exec rspec spec/features/$i"
fi
done
@joncalhoun
joncalhoun / cloudSettings
Last active August 17, 2020 14:57
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-17T14:57:52.730Z","extensionVersion":"v3.4.3"}
@joncalhoun
joncalhoun / ..README.md
Last active June 27, 2025 03:22
Most of my settings for a new mac

Chrome

  • Download & install Chrome
  • Login & sync settings/whatever else

Mac OS settings

  • General -> Use dark menu bar
  • General -> Default web browser: Google Chrome
gotest() {
go test $* | sed ''/PASS/s//$(printf "\033[32mPASS\033[0m")/'' | sed ''/FAIL/s//$(printf "\033[31mFAIL\033[0m")/'' | sed ''/FAIL/s//$(printf "\033[31mFAIL\033[0m")/'' | GREP_COLOR="01;33" egrep --color=always '\s*[a-zA-Z0-9\-_.]+[:][0-9]+[:]|^'
}
type Messenger struct {
// Add this field here
Client *http.Client
mux *http.ServeMux
messageHandlers []MessageHandler
deliveryHandlers []DeliveryHandler
readHandlers []ReadHandler
postBackHandlers []PostBackHandler
optInHandlers []OptInHandler
// The builder pattern makes it really hard to return errors during a build
// step. Consider using functional options instead, which work much better with
// incremental errors.
// Let's say you have the builder pattern.
type T struct { ... }
func (t *T) A(arg string) *T {
// do stuff here with t and arg
return t