Skip to content

Instantly share code, notes, and snippets.

@jbgo
jbgo / Gemfile
Created November 1, 2013 20:45
deprecation warnings in test after upgrading from rails 4.0.0 to 4.0.1
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.1'
gem 'pg'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
@jbgo
jbgo / README.md
Last active December 30, 2015 06:38
Comparing ruby and go

Comparison of a simple, idiomatic ruby program to a similar go program.

To run the ruby program: ruby mammals.rb

To run the go program: go run mammals.go

Read the detailed comparison on my blog.

@jbgo
jbgo / go-isms.md
Last active December 31, 2015 22:49
go-isms

Starting a collection of common programming tasks expressed in Go.

Read a file as a string

Imports: bytes, io/ioutil

data, err := ioutil.ReadFile("path/to/file")
buf := bytes.NewBuffer(data)
str := buf.String()
@jbgo
jbgo / Gemfile
Created February 15, 2014 19:16
Heroku-style config management with capistrano and chef
gem 'dotenv-rails'
group :deployment do
gem 'capistrano', '~>2.15'
gem 'chef'
end
@jbgo
jbgo / tictactoe.rb
Created March 7, 2014 19:31
Interactive tic tac toe game
class TicTacToeApp
NIL_GAME = [
[nil, nil, nil],
[nil, nil, nil],
[nil, nil, nil]
]
def initialize
@game = NIL_GAME
@jbgo
jbgo / Gemfile
Last active October 19, 2015 16:32
Examples for Better TDD in PHP with Rake and Guard https://opensolitude.com/2015/10/18/phpunit-tests-rake-guard.html
source "https://rubygems.org"
gem "guard-rake"
@jbgo
jbgo / text-editor-shootout.md
Created October 28, 2015 17:27
Text editor shootout for KE LnL

Installation

brew install neovim

Then add the following to your ~/.bashrc

alias vi=neovim
alias vim=neovim
@jbgo
jbgo / bulk.json
Created December 21, 2015 15:43
elasticsearch issue sample data
POST rolodex/people/_bulk
{"index":{}}
{"first_name":"elit","last_name":"orci"}
{"index":{}}
{"first_name":"diam","last_name":"habitant"}
{"index":{}}
{"first_name":"quis","last_name":"scelerisque"}
{"index":{}}
{"first_name":"ligula","last_name":"Nunc"}
{"index":{}}