This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'uri' | |
require 'net/http' | |
require 'openssl' | |
class UrlResolver | |
def self.resolve(uri_str, agent = 'curl/7.43.0', max_attempts = 10, timeout = 10) | |
attempts = 0 | |
cookie = nil | |
until attempts >= max_attempts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(duration) { | |
return function(){ | |
return new Promise(function(resolve, reject){ | |
setTimeout(function(){ | |
resolve(); | |
}, duration) | |
}); | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/serializers/customer_serializer_spec.rb | |
class CustomerSerializer < ActiveModel::Serializer | |
attributes :customer_number, :email, :username | |
def customer_number | |
object.account_number | |
end | |
def merchant_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "spec_helper" | |
describe ExampleMailer do | |
describe :new_user do | |
let(:user) { FactoryGirl.create :user } | |
it "sends to the correct addresses" do | |
# :mail is similar to the controller specs 'get', 'post' etc methods | |
mail :new_user, user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \ | |
"/usr/local/lib/libosxfuse_i32.2.dylib" \ | |
"/usr/local/lib/libosxfuse_i64.2.dylib" \ | |
"/usr/local/lib/libmacfuse_i64.2.dylib" \ | |
"/usr/local/lib/libosxfuse_i32.la" \ | |
"/usr/local/lib/libosxfuse_i64.la" \ | |
"/usr/local/lib/pkgconfig/osxfuse.pc" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Quotes: Replace smart double quotes with straight double quotes. | |
//ANSI version for use with 8-bit regex engines and the Windows code page 1252. | |
preg_replace('[\x84\x93\x94]', '"', $text); | |
//Quotes: Replace smart double quotes with straight double quotes. | |
//Unicode version for use with Unicode regex engines. | |
preg_replace('[\u201C\u201D\u201E\u201F\u2033\u2036]', '"', $text); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "member password recovery" do | |
# As a member who forgot my password | |
# I want to recover my site access easily | |
# | |
attr_accessor :current_email_address | |
specify "email recovery of a new password" do | |
member = make_activated_member |