Remove old containers.
docker ps -a | grep 'weeks ago' | awk '{print $1}' | \
xargs --no-run-if-empty docker rm
# I know what you are saying about the composition. | |
# I know that this simple example doesn't represent the | |
# composability that you probably trying to do. | |
# But this is how I would do what you want. | |
# You already know all this so I'm wasting your time actually. | |
# => | |
# hi! | |
# hi! | |
# hello! |
# RSpec really does have an identity crisis. It's not quite ruby and it's | |
# not quite English. But what if we really made our tests complicated | |
# with shared_examples that behave like mixins sorta? How bad would this be? | |
# rspec --format doc lunch_spec.rb | |
shared_examples "charge" do | |
let(:cash_register) { "ding!" } | |
it "charges a price" do |
Guy at coffee shop. I'm playing with my adafruit goggles, trying to make a part list. | |
Guy: What's that. | |
Me: LED Goggles. | |
Guy: Do they let you see in 3D. | |
Me: No. | |
Guy: Do they let you ride your bike at night? | |
Me: They aren't that bright. | |
Guy: Do they let you read better. | |
Me: Actually they sort of blind you. |
Remove old containers.
docker ps -a | grep 'weeks ago' | awk '{print $1}' | \
xargs --no-run-if-empty docker rm
# <<foo doesn't trim leading whitespace. No problem. :cake: | |
<<EOS | |
hi | |
EOS | |
=> " hi\n" | |
# I thought the difference between << and <<- was the leading whitespace trimming. | |
<<-EOS | |
hi | |
EOS |
blog post draft
Get up and running. Install it. I'm sure you know how. But then maybe you are used to mysql>
? Where is the database? How do I even start?
sudo -u postgres -i
- This is your system account that pg runs as. Switch to it and we'll create a sandbox database.createuser name
- Where "name" is your normal user account you use.createdb name -O name
- Where "name" is your normal user account you use.# Python boolean fail | |
# Or how to redefine True and False and win any argument on the internet! | |
# Love, @tlehman | |
from unittest import TestCase | |
class BoolFail(TestCase): | |
def test_false(self): | |
True = False | |
assert True == False |
# run me with watchr watchr.rb in a ruby project | |
# don't run me in a rails project. :) | |
# run me with test unit. | |
# don't run me with rspec or cucumber, check out my other watchr gists | |
ENV["WATCHR"] = "1" | |
system 'clear' | |
def growl(message) | |
growlnotify = `which growlnotify`.chomp |
# this is a watchr script for command line programs | |
# not rails. @squarism | |
ENV["WATCHR"] = "1" | |
system 'clear' | |
def growl(message) | |
growlnotify = `which growlnotify`.chomp | |
title = "Watchr Test Results" | |
passed = message.include?('0 failures') |
#!/usr/bin/env bash | |
# wtchr shell script - @squarism | |
# INSTALL | |
# gem install watchr | |
# cp wtchr ~/bin | |
# chmod u+x ~/bin/wtchr | |
# Run with: wtchr foo.rb |