fjord
- rasphilco/fjord
- Simplified local node/python/ruby app development for MacOS. Powered by Heroku buildpacks.
rabbit hole
- rasphilco/rh
- Find any executable on $PATH and view its symlink chain
oclif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'singleton' | |
class Subscriber | |
include Singleton | |
attr_reader :subscriptions | |
def initialize | |
@subscriptions = {} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provider "virtualbox" do |vb| | |
vb.memory = "4096" | |
vb.cpus = "2" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git aliases | |
alias g 'git' | |
alias gst 'git status' | |
alias gd 'git diff' | |
alias gco 'git checkout' | |
alias ga 'git add' | |
alias gcm 'git commit -m' | |
alias gl "git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold | |
green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
require 'minitest/mock' | |
# From the Queen herself, Sandi Metz | |
# https://www.youtube.com/watch?v=URSWYvyc42M | |
# http://jnoconor.github.io/images/unit-testing-chart-sandi-metz.png | |
class Gear | |
attr_reader :chainring, :cog, :wheel, :observer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
Tree = Struct.new(:value, :left, :right) | |
class TestTree < Minitest::Test | |
def test_is_tree_sorted_true | |
seven = Tree.new(7) | |
three = Tree.new(3) | |
five = Tree.new(5, three, seven) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extended from https://stackoverflow.com/questions/10661610/implement-a-tree-iterator | |
class Node | |
attr_accessor :data, :children | |
def initialize(data, *children) | |
@data = data | |
@children = children | |
end |
There are three great virtues of a programmer:
- Laziness: The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful and document what you wrote so you don't have to answer so many questions about it.
- Impatience: The anger you feel when the computer is being lazy. This makes you write programs that don't just react to your needs, but actually anticipate them. Or at least pretend to.
- Hubris: The quality that makes you write (and maintain) programs that other people won't want to say bad things about.
Four rules for developers:
NewerOlder