Skip to content

Instantly share code, notes, and snippets.

@english
english / .ruby-version
Last active April 27, 2018 23:03
`WillPaginate` not serving a 404 when it should - https://github.com/mislav/will_paginate/pull/572
2.2.3
@english
english / webmock-bug.rb
Created February 2, 2017 19:58
Reproduction of "ArgumentError: invalid byte sequence in UTF-8" webmock bug
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'webmock', '1.24.6'
end
include WebMock::API
# http://blog.klipse.tech/clojure/2016/10/02/parsing-with-derivatives-regular.html
# implemented in ruby
# The empty language:
class Empty; end
# The null language ϵ (that contains only the empty string):
class Eps; end
# The language that contains a single string made of a single character:
@english
english / highlight.js
Created December 4, 2016 04:34
Code highlight SICP
javascript:(function() {
var colorScheme = 'solarized-light';
var link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('href', '//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/styles/' + colorScheme + '.min.css');
document.getElementsByTagName('head')[0].appendChild(link);
var script = document.createElement('script');

Keybase proof

I hereby claim:

  • I am english on github.
  • I am english (https://keybase.io/english) on keybase.
  • I have a public key ASBZkRpnCdexrt0T02Yg8qvgBTpWayHSkX1G0vP66hXEHQo

To claim this, I am signing this object:

err = StringIO.new
out = StringIO.new
RSpec::Core::Runner.run([ "path/to/my_spec.rb", "--format", "json" ], err, out)
puts out.string
# .. spec results ..
out.rewind
RSpec::Core::Runner.run([ "path/to/my_spec.rb", "--format", "json" ], err, out)
puts out.string