Skip to content

Instantly share code, notes, and snippets.

View anicholson's full-sized avatar

Andy Nicholson anicholson

View GitHub Profile
@anicholson
anicholson / README.md
Created August 31, 2016 06:21
Crystal Language resources

Installing Crystal

  • On OSX: brew install crystal-lang
  • On Linux: [See instructions][installation_instructions]
  • On Windows: Sorry, not yet. You may be able to, but it’s not officially supported.

Further talks

  • [Matz' Keynote @ RubyConf 2014][matz]
  • [Consider Static Typing: Tom Stuart @ RubyConfAU 2015][stuart]
#!/bin/bash
wait_until_up () {
echo "Waiting for $1 to come up!"
until $(curl --output /dev/null --silent --fail "$2"); do
printf '.'
sleep 1
done
Here's a minimal schema that fails when input has stringified keys, and passes with symbolized keys.
# A sample Gemfile
source "https://rubygems.org"
gem 'rack'
gem 'roda'
@anicholson
anicholson / keybase.md
Created December 9, 2015 00:20
keybase.md

Keybase proof

I hereby claim:

  • I am anicholson on github.
  • I am andrewdotnich (https://keybase.io/andrewdotnich) on keybase.
  • I have a public key ASD9uQS7he9dDqhPl638kbWfHGifEyTiqlDvbNh1UGpA9Qo

To claim this, I am signing this object:

module Hangman (Model, Letter, initialModel, Action, update, view, main) where
{-| A hangman game in Elm.
@docs Model
@docs Letter
@docs Action
@docs initialModel
@docs update
@docs view
@anicholson
anicholson / RSpec 3.2.3 output
Created May 13, 2015 03:14
Why don't RSpec instance_doubles honour the entire object API?
$ rspec sorting_spec.rb
F
Failures:
1) SortableThing can be sorted
Failure/Error: sorted = [thing1, thing2].sort
ArgumentError:
comparison of RSpec::Mocks::InstanceVerifyingDouble with RSpec::Mocks::InstanceVerifyingDouble failed
# ./sorting_spec.rb:20:in `sort'
@anicholson
anicholson / SassMeister-input.scss
Created March 24, 2015 02:46
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
$foo: blue;
#one {
color: $foo;
@anicholson
anicholson / bowling.rb
Created January 19, 2015 06:50
Bowling Kata
class Bowling
class EmptyFrame
def pin_total
0
end
def scores
[0,0]
end
@anicholson
anicholson / understanding_refinements.rb
Last active August 29, 2015 14:13
Do refinements apply only to instance methods?
class Traveller
def what_are_you
puts "I'm a Backpacker"
end
def self.preferred_accommodation
puts "Hostels"
end
end