Skip to content

Instantly share code, notes, and snippets.

@danajp
danajp / docker-compose.yml
Created March 29, 2016 01:48
Mesos/Marathon stack
# Docker compose config file. This will configure marathon for you in docker containers. Web consoles port
# numbers are:
#
# Marathon: 8080
# Mesos: 5050
# Zookeeper: 8082/exhibitor/v1/ui/index.html
#
# This file now requires that you have the DOCKER_IP environment
# variable present when you run `docker-compose up`. This should be
# set to the address of your docker virtual machine, or 'localhost' if
@danajp
danajp / spreadsheet_validator_spec.rb
Created May 6, 2015 18:12
Using nested context blocks in rspec
class SpreadsheetValidator
def initialize(spreadsheet_reader)
@reader = spreadsheet_reader
@errors = []
end
def has_errors?
@errors.length > 0
end
@danajp
danajp / rspec_and_yield_example.rb
Created April 17, 2015 20:28
Using RSpec Mocks' and_yield
class CSVOddUpcaser
# Pretty contrived, but whatever.
#
# Reads rows from a CSV object, upcases the data in the odd numbered
# rows and writes rows to a new CSV object.
def initialize(csv)
@csv = csv
end

Keybase proof

I hereby claim:

  • I am danajp on github.
  • I am danajp (https://keybase.io/danajp) on keybase.
  • I have a public key whose fingerprint is 8AB2 2F3C 33CB EC25 C94A D8ED 056F 3F7A D2D4 4848

To claim this, I am signing this object:

(c-add-style "php-pear-k&r-mods" '("k&r"
(c-basic-offset . 4)
(c-offsets-alist . ((case-label . +)
(arglist-close . 0)
(inline-open . 0)))
(c-hanging-braces-alist . ((defun-open after)
(inline-open after)
(substatement-open after)))))
(add-hook 'php-mode-hook '(lambda ()
(message "setting style to php-pear")