Skip to content

Instantly share code, notes, and snippets.

View MattHall's full-sized avatar
🤖

Matt Hall MattHall

🤖
View GitHub Profile

Keybase proof

I hereby claim:

  • I am MattHall on github.
  • I am codebeef (https://keybase.io/codebeef) on keybase.
  • I have a public key whose fingerprint is 1425 2666 97E8 653E 3896 26FE 71B8 AFCA 9AFC CE54

To claim this, I am signing this object:

# Support for Rspec / Capybara subdomain integration testing
# Make sure this file is required by spec_helper.rb
#
# Sample subdomain test:
# it "should test subdomain" do
# switch_to_subdomain("mysubdomain")
# visit root_path
# end
DEFAULT_HOST = "lvh.me"
*** [err :: xxx.xxx.xxx.xxx] Invalid gemspec in [/var/apps/myapp-staging/shared/bundle/ruby/1.8/specifications/carrierwave-0.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x11e87478> 1.1.4"]
*** [err :: xxx.xxx.xxx.xxx]
*** [err :: xxx.xxx.xxx.xxx] Invalid gemspec in [/var/apps/myapp-staging/shared/bundle/ruby/1.8/specifications/carrierwave-0.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x11e87478> 1.1.4"]
*** [err :: xxx.xxx.xxx.xxx]
*** [err :: xxx.xxx.xxx.xxx] WARNING: #<ArgumentError: Illformed requirement ["#<YAML::Syck::DefaultKey:0x11e87478> 1.1.4"]>
*** [err :: xxx.xxx.xxx.xxx] # -*- encoding: utf-8 -*-
*** [err :: xxx.xxx.xxx.xxx]
*** [err :: xxx.xxx.xxx.xxx] Gem::Specification.new do |s|
*** [err :: xxx.xxx.xxx.xxx] s.name = %q{carrierwave}
*** [err :: xxx.xxx.xxx.xxx] s.version = "0.6.0"
@MattHall
MattHall / Rakefile
Created February 11, 2012 15:44
Rake task for creating new posts in Jekyll
require 'rubygems'
require 'optparse'
require 'yaml'
task :np do
OptionParser.new.parse!
ARGV.shift
title = ARGV.join(' ')
path = "_posts/#{Date.today}-#{title.downcase.gsub(/[^[:alnum:]]+/, '-')}.markdown"
require 'spec_helper'
describe NewsletterSubscriber do
describe "validations" do
before(:each) do
NewsletterSubscriber.create(:email => "[email protected]")
end
it { should validate_presence_of(:email) }
it { should validate_uniqueness_of(:email) }
require 'net/http'
require 'uri'
require 'rubygems'
@auth = {:api_token => 'my token'}
Net::HTTP.start('posterous.com') {|http|
req = Net::HTTP::Get.new("/api/v2/users/me/sites/primary/posts?api_token=#{@auth[:api_token]}")
req.basic_auth 'my email address', 'my password'
response = http.request(req)
module ErrorsHelper
def error_messages_for(*params)
options = params.extract_options!.symbolize_keys
if object = options.delete(:object)
objects = Array.wrap(object)
else
objects = params.collect {|object_name| instance_variable_get("@#{object_name}") }.compact
end
module MultiparameterHack
def self.included klass
klass.class_eval do
@date_error_on_attribute = nil
def validate
errors.add_to_base "Invalid Date #{@date_error_on_attribute}" if @date_error_on_attribute
end
undef :execute_callstack_for_multiparameter_attributes
var DerivedClass = Class.create(ParentClass, {
initialize: function($super, param1) {
}
}
[[Reachability reachabilityForLocalWiFi] currentReachabilityStatus] == ReachableViaWiFi