Skip to content

Instantly share code, notes, and snippets.

bkerley / .gitignore
Last active May 8, 2019 03:06
View .gitignore
View gist:e9990ce83cf961f37ed3d60326ab8d88
  • 80 grams (about 1 cup whole beans) coffee
  • 2 cups room temperature water

Makes about 3 iced-coffee

  1. Grind beans coarsely, I used one setting below the coarsest. Mix water and coffee into a container, cover, and let sit for 10 hours.
  2. After, filter the brewed coffee as best you can. The result will be strong, too strong to drink. I suggest diluting with 0.5:1.0 water to brew.
  3. Pour over ice, or, heat.
bkerley / Vagrantfile.rb
Created January 19, 2016 16:27
my riak time series dev environment
View Vagrantfile.rb
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
View simple.ex
defmodule Simple do
@doc ~S"""
# Example
iex> Simple.toot()
def toot() do
bkerley / pipes.rb
Last active April 8, 2018 02:17
elixir-style function chaining that is also awful!
View pipes.rb
require 'pp'
class Object
def mutate
class Mutagen < BasicObject
def initialize(collection)
bkerley / find_matches.json
Created February 19, 2015 01:30
kibana queries
View find_matches.json
"query": {
"filtered": {
"query": {
"bool": {
"should": [
"query_string": {
"query": ""
bkerley / crdt_searching.rb
Created February 12, 2015 13:22
RFC: Yokozuna and CRDTs in Ruby
View crdt_searching.rb
# the nice thing about this improved yz api is that it's not released yet! i can
# do anything, i'm the master of time!
# this is how we search pretty much anything
query = client, index, 'cool search term'
results = query.results # actually hits riak, gives us a ResultsCollection
# existing robject functionality
robject_md =[0]
# equivalent
View gist:50bbe45972dc85c8436f
class Cell
def initialize
def eigenclass
class << self
View corpse.rb
def puts(crap); super("stop using puts"); end #dave
def puts(s); super; super("WAT"); (s=s.to_s).reverse!; end # hiro
puts greeting = "Hello Ruby DCamp! It is %s" % # hiro
puts (words ='/usr/share/dict/words').split).length #bryce
puts (butt_words = {|w| w =~ /butt/}).length #bryce
words = {|w| w =~ /ity$/ } # Jason
words ={|w|"aeiou", ('a'..'z').to_a.sample(5).join)} # max
puts sentence = ({words.sample.reverse}.join " LOL ") # Joshsz
puts upsentence = sentence.upcase # max
new_things = `ls /tmp`; puts new_things # Luqi
View per_class_errors.rb
require 'pry'
module SomeRecord
class Base
def do_something
def self.inherited(subclass)
subclass.const_set :NotFoundError,