Skip to content

Instantly share code, notes, and snippets.

Jip van Reijsen britishtea

Block or report user

Report or block britishtea

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bad.rb
class Foo
attr_accessor :x
end do
x = 5
View test_helper.rb
require "simplecov"
SimpleCov.command_name "unit:#{}"
SimpleCov.at_exit do
orig, $stdout = $stdout,"/dev/null", "w")
$stdout, orig = orig, nil
View ring_buffer.rb
class RingBuffer
attr_reader :capacity, :size
def initialize(capacity)
@array =
@capacity = capacity
@read_index = 0
@size = 0
View ansible.yml
- hosts: servers
- role: server
{{ port }}:
internal: "{{ groups['clients'] }}"
britishtea / _instructions.txt
Last active Jul 13, 2016
Run terco on login on Mac OS X
View _instructions.txt
This are instructions to run terco on login on Mac OS X.
1. Install terco using the system ruby (sudo gem install terco).
2. Copy the script below to ~/Library/LaunchAgents/com.soveran.terco.plist. You may have to replace `/usr/local/bin/terco`, if terco has been installed to a different directory (use `which terco` to find out).
3. Load the script using the command
sudo launchctl load ~/Library/LaunchAgents/com.soveran.terco.plist
To make a domain resolve to localhost follow these instructions:
britishtea / benchmark.rb
Created Feb 20, 2015
Is _ as an argument name optimized or just a convention?
View benchmark.rb
def does_care(*a)
def cares_a_little(*_a)
def does_not_care(*_)
britishtea /
Last active Dec 18, 2018
My right prompt for the fish shell.
function fish_right_prompt -d "Write out the right prompt"
set -l exit_code $status
set -l is_git_repository (git rev-parse --is-inside-work-tree ^/dev/null)
set_color black
# Print a yellow fork symbol when in a subshell
set -l max_shlvl 1
test $TERM = "screen"; and set -l max_shlvl 3
britishtea /
Last active Apr 5, 2016
Bookmarking directories in the fish shell. Copy the file to $fish_function_path (~/.config/fish/functions by default) as to install.
function jump -d "Jumps to a marked directory"
# If $JUMP_PATH isn't set, use a default (~/.config/jump).
if set -q $JUMP_PATH
set JUMP_PATH $HOME/.config/jump
# If the $JUMP_PATH directory doesn't exist, create it.
if not test -d $JUMP_PATH
mkdir -p $JUMP_PATH
britishtea / result.txt
Created Jan 26, 2015
Building a long chain of words (PPCG code golf challenge)
View result.txt
["Del", "Delmar", "mar", "mariachi", "chickpea", "pea", "peahen", "henpecking", "ingraining", "ingratiated", "tedious", "ousters", "ersatzes", "zest", "estranging", "ingenuously", "sly", "slyness", "essayist", "isthmus", "mushing", "ingredient", "entertainment", "entryway", "waywardness", "essences", "cession", "ion", "ionization", "ionizer", "zeros", "roses", "sesame", "amelioration", "ionosphere", "erection", "ionospheres", "resale", "alerted", "tediously", "slyest", "establishment", "entrenchment", "entombed", "bedevilment", "entailing", "inglorious", "ousting", "ingested", "tediousness", "essay", "saying", "ingrown", "ownership", "hippie", "piercingly", "glycerin", "ringing", "ingrains", "insurgent", "entertainingly", "glycerol", "rolling", "ingenuousness", "essaying", "ingenuous", "ouster", "terracing", "ingesting", "ingratiating", "ingestion", "ionizing", "ingot", "got", "gotten", "tensing", "ingrates", "testable", "blest", "estimations", "onshore", "ore", "ores", "restructure", "urea", "rears", "arseni
britishtea / benchmark.rb
Last active Aug 29, 2015
Array#join vs Regexp.union (ran on Ruby 2.0.0)
View benchmark.rb
require "benchmark/ips"
input = %w[one two three four five six seven]
Benchmark.ips do |x| "Array#join" do { |e| Regexp.escape e }.join "|"
end "Regexp.union" do
You can’t perform that action at this time.