Skip to content

Instantly share code, notes, and snippets.

View markburns's full-sized avatar
💭
👋

Mark Burns markburns

💭
👋
View GitHub Profile
@markburns
markburns / errorWrapper.js
Last active August 29, 2015 14:05
I wonder if there's any cross-browser libraries that do this kind of thing
error = {
message: "Expected true to be false.",
stack: "Error: Expected true to be false.\n at new jasmine.ExpectationResult (http://0.0.0.0:3001/relative/assets/jasmine/1.3.1.js?body=1:114:32)\n at null.toBe (http://0.0.0.0:3001/relative/assets/jasmine/1.3.1.js?body=1:1237:29)\n at null.<anonymous> (http://0.0.0.0:3001/relative/assets/integration/integration_spec.js?body=1:11:27)\n at jasmine.Block.execute (http://0.0.0.0:3001/relative/assets/jasmine/1.3.1.js?body=1:1066:17)\n at jasmine.Queue.next_ (http://0.0.0.0:3001/relative/assets/jasmine/1.3.1.js?body=1:2098:31)\n at jasmine.Queue.start (http://0.0.0.0:3001/relative/assets/jasmine/1.3.1.js?body=1:2051:8)\n at jasmine.Spec.execute (http://0.0.0.0:3001/relative/assets/jasmine/1.3.1.js?body=1:2378:14)\n at jasmine.Queue.next_ (http://0.0.0.0:3001/relative/assets/jasmine/1.3.1.js?body=1:2098:31)\n at jasmine.Queue.start (http://0.0.0.0:3001/relative/assets/jasmine/1.3.1.js?body=1:2051:8)\n at jasmine.Suite.execute (http://
require 'faraday'
require 'faraday_middleware'
require 'byebug'
def connection
@connection ||=
Faraday::Connection.new 'http://www.letsrevolutionizetesting.com/' do |c|
c.request :json
c.response :json, :content_type => /\bjson$/
module I15r; end
module Visitable
def accept(visitor)
visitor.send visitor_method_name, self
end
def visitor_method_name
"visit_#{self.class.name}".gsub(/::/, "__")
end
editor = ENV['EDITOR']
mapping = {
[:textmate, :txmt, :tm] => :textmate,
[:sublime, :subl, :st] => :sublime,
[:macvim, :mvim, :vim] => :macvim
}
mapping.each do |matches, value|
matches.each do |m|
@markburns
markburns / pgp.txt
Created August 24, 2013 19:16
PGP public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: OpenPGP.js v.1.20130820
Comment: http://openpgpjs.org
xo0EUhkGSQEEAIzpd6WBTyNt7wdBenr6Dj9eDnyRRCsy/n6TO7ow1SOT6h+k
t+p8MvYO2G+TprApJeIiFlZPCA6RdP2FPhQePyBSbf3VRrDDlojmRXOs+iWr
yzT1CGrnkkc46wKque6c4BXtz2dVb+y1TSQfn8BaKTfY8pvrj9agbOPCaE2C
gMt1ABEBAAHNJ01hcmsgQnVybnMgPG1hcmt0aGVkZXZlbG9wZXJAZ21haWwu
Y29tPsKcBBABCAAQBQJSGQZKCRCf0oceVRzIIQAASRYEAIdxD0oOrjRWRDbi
NESuwAJG6vJtNdaQ1HLTZixDmUWPlHHcRuxzxg/mU+BPQUGdA29xck54dBsr
layout title date comments categories
post
Ruby Hacking Guide ch. 11: Finite-state scanner
2013-04-01 02:19
true
software
ruby
insanity
@markburns
markburns / javascript_fixture_generation_methods.rb
Created July 18, 2013 07:48
Javascript fixtures with teaspoon
module JavascriptFixtureGenerationMethods
# Saves the markup to a fixture file using the given name
def save_fixture_for_jasmine(name, markup=html_for('body'))
fixture_path = Rails.root.join('public/fixtures')
Dir.mkdir(fixture_path) unless File.exists?(fixture_path)
fixture_file = File.join(fixture_path, "#{name}.fixture.html")
File.open(fixture_file, 'w') { |f| f << markup }
end
subject { App.new }
App::PURPOSES.each do |p,_|
context do
before { subject.purpose = p }
its(:purpose){ should == p }
end
end
App::PLATFORMS.each do |p,_|
@markburns
markburns / gist:4579503
Created January 20, 2013 16:02
strange bundler hanging debug loop
115 lookup = Hash.new { |h,k| h[k] = [] }
116 specs = @specs.sort_by do |s|
117 s.platform.to_s == 'ruby' ? "\0" : s.platform.to_s
118 end
119 specs.reverse_each do |s|
=> 120 lookup[s.name] << s
121 end
122 lookup
123 end
124 end
@markburns
markburns / Gemfile
Created November 20, 2012 06:29
Problem with include_context and shared_examples_for
source :rubygems
gem 'rspec'