I hereby claim:
- I am notahat on github.
- I am notahat (https://keybase.io/notahat) on keybase.
- I have a public key ASBqO0GTuXC19c1Vf9IeExNNmrbDfTmw47SxvTu6G-P3BAo
To claim this, I am signing this object:
# Here's everything I have in my .zshrc to set up my PATH for homebrew and asdf: | |
export PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
eval "$(/opt/homebrew/bin/brew shellenv)" | |
source $HOMEBREW_PREFIX/opt/asdf/libexec/asdf.sh | |
# The resulting $PATH looks like this: | |
# |
I hereby claim:
To claim this, I am signing this object:
$ ping 111.118.175.56 | |
PING 111.118.175.56 (111.118.175.56): 56 data bytes | |
64 bytes from 111.118.175.56: icmp_seq=0 ttl=55 time=15.581 ms | |
64 bytes from 111.118.175.56: icmp_seq=1 ttl=55 time=17.552 ms | |
64 bytes from 111.118.175.56: icmp_seq=2 ttl=55 time=17.283 ms | |
^C | |
--- 111.118.175.56 ping statistics --- | |
3 packets transmitted, 3 packets received, 0.0% packet loss | |
round-trip min/avg/max/stddev = 15.581/16.805/17.552/0.873 ms |
module PrivateClass | |
def self.included(mod) | |
*parent, child = mod.name.split("::") | |
Object.const_get(parent.join("::")).private_constant(child) | |
end | |
end | |
module Container | |
class PublicThing | |
def hello |
I hereby claim:
To claim this, I am signing this object:
module Container | |
class PublicThing | |
def hello | |
PrivateThing.new.hello | |
end | |
end | |
class PrivateThing | |
def hello | |
"Hello, world!" |
# On a new ubuntu 14.04 box, as root, with the following variables | |
# export BUILDBOX_AGENT_NAME="buildbox-agent-N" | |
# export BUILDBOX_AGENT_ACCESS_TOKEN="<your token here>" | |
# export BUILDBOX_AGENT_SSH_PRIVATE_KEY="<an ssh private key>" | |
# export BUILDBOX_AGENT_SSH_PUBLIC_KEY="<an ssh public key>" | |
# Make tmp totally in memory | |
echo "none /tmp tmpfs size=4g 0 0" >> /etc/fstab | |
mount /tmp |
class PagingEnumerator < Enumerator | |
def initialize(&block) | |
super do |yielder| | |
page = 0 | |
loop do | |
items = block.call(page) | |
break if items.empty? | |
items.each {|item| yielder.yield(item) } | |
page += 1 |
# I have a class that delegates functionality to a couple of objects that it | |
# constructs. I want to test this in isolation. I want to make sure that the | |
# objects are constructed with the right arguments. I also want to make sure | |
# that the results from the objects are handled correctly. | |
# | |
# I'm finding it hard to structure the code and test in a way that isn't | |
# cumbersome. What's below works, but it feels like a lot of stubbing and setup | |
# for something the should be simpler. | |
# | |
# Anyone got a better approach for this? |
class Dependency | |
def self.foo | |
puts "Foo" | |
end | |
def self.bar | |
puts "Bar" | |
end | |
end |