Skip to content

Instantly share code, notes, and snippets.

James Mead floehopper

Block or report user

Report or block floehopper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@floehopper
floehopper / Gemfile
Last active Aug 29, 2015
Teardown sequence for Mocha / MiniTest / ActiveSupport
View Gemfile
source 'https://rubygems.org'
gem 'activesupport'
gem 'mocha'
View class_method_definitions.rb
# example 1
class Foo; end
def Foo.bar; end
# example 2
class Foo
def self.bar; end
end
View gist:9974356
$ npm install
# output ommitted for brevity
$ grunt mxmlc
Running "mxmlc:videojs_swf" (mxmlc) task
File "dist/video-js.swf" created.
Done, without errors.
jamesmead@floehopper.local:~/Code/videojs/video-js-swf:master$ grunt connect:dev
@floehopper
floehopper / videojs-test-output.txt
Created Apr 4, 2014
Building and running video.js tests
View videojs-test-output.txt
$ npm install
# output ommitted for brevity
$ grunt
# output ommitted for brevity
$ grunt test
Running "jshint:src" (jshint) task
View keybase.md

Keybase proof

I hereby claim:

  • I am floehopper on github.
  • I am floehopper (https://keybase.io/floehopper) on keybase.
  • I have a public key whose fingerprint is B10D 919D E3B2 3B55 8FF3 80E1 CD75 D7BD 899B 8102

To claim this, I am signing this object:

View passenger-lib-rack-name-error.txt
*** Exception NameError in PhusionPassenger::Rack::ApplicationSpawner (undefined method `ssl?' for class `Sinatra::Request') (process 21881, thread #<Thread:0x7f7c50c932d0>):
from /home/webhooks/app/vendor/gems/ruby/1.8/gems/sinatra-1.4.5/lib/sinatra/base.rb:49
from /home/webhooks/app/vendor/gems/ruby/1.8/gems/sinatra-1.4.5/lib/sinatra.rb:1:in `require'
from /home/webhooks/app/vendor/gems/ruby/1.8/gems/sinatra-1.4.5/lib/sinatra.rb:1
from ./app.rb:5:in `require'
from ./app.rb:5
from config.ru:1:in `require'
from config.ru:1
from /usr/lib/ruby/1.8/rack/builder.rb:46:in `instance_eval'
from /usr/lib/ruby/1.8/rack/builder.rb:46:in `initialize'
@floehopper
floehopper / patches-for-rails-and-rack-for-argument-error-invalid-byte-sequence.rb
Last active Aug 29, 2015
Patches for Rails and Rack for ArgumentError: invalid byte sequence
View patches-for-rails-and-rack-for-argument-error-invalid-byte-sequence.rb
# Based on these Rack commits [1,2] which originated from this Rack PR [3] and
# mentioned in this Rails PR [4].
#
# [1]: https://github.com/rack/rack/commit/cc8279f4a158e51975838e6202581c3d5e33f1c4
# [2]: https://github.com/rack/rack/commit/975ccac7e56dcd765cb102016b97ef13d15feba8
# [3]: https://github.com/rack/rack/pull/713
# [4]: https://github.com/rails/rails/pull/11795
require 'rack/utils'
@floehopper
floehopper / handle-google-apps-invoice.js
Created May 2, 2015
Spike on automatically saving Google Apps invoice attachment from Gmail into Google Drive using Google App Script
View handle-google-apps-invoice.js
function myFunction() {
var threads = GmailApp.search("label:inbox subject:'Google Enterprise: Your invoice is attached'");
for (var threadIndex = 0 ; threadIndex < threads.length; threadIndex++) {
var messages = threads[threadIndex].getMessages();
if (messages.length == 0) {
Logger.log('No messages found in thread.');
return;
}
var message = messages[0];
var attachments = message.getAttachments();
@floehopper
floehopper / rendering-date-questions.md
Created May 12, 2015
Smart Answer - Rendering Date Questions
View rendering-date-questions.md

Smart Answer Flows

Question

show.html.erb
  _content.html.erb
    _current_question.html.erb
      ::QuestionPresenter#partial_template_name
        _date_question.html.erb
          ::DateQuestionPresenter (undefined)
View Gemfile
source 'https://rubygems.org'
gem 'minitest'
gem 'webmock'
You can’t perform that action at this time.