Skip to content

Instantly share code, notes, and snippets.

View Wirwing's full-sized avatar
🧨
A darle jarana!

Irving Caro Wirwing

🧨
A darle jarana!
View GitHub Profile
@iloveitaly
iloveitaly / capybara_fill_stripe_elements.rb
Created March 4, 2017 21:21
Fill in a Stripe Elements (https://stripe.com/docs/elements) credit card field using capybara
def fill_stripe_elements(card)
using_wait_time(15) { within_frame('stripeField_card_element0') do
card.to_s.chars.each do |piece|
find_field('cardnumber').send_keys(piece)
end
find_field('exp-date').send_keys("0122")
find_field('cvc').send_keys '123'
find_field('postal').send_keys '19335'
end }
@timtyrrell
timtyrrell / faker_stuff.rb
Created August 24, 2012 20:34
Faker defining sequences for FactoryGirl
# spec/support/sequences.rb
FactoryGirl.define do
sequence(:username) { |n| Faker::Internet.user_name + "-#{n}" }
sequence(:first_name) { Faker::Name.first_name }
sequence(:last_name) { Faker::Name.last_name }
sequence(:name) { |n| "#{Faker::Lorem.sentence}-#{n}" }
#etc
end
#spec/factories/example_stuff.rb
@tugberkugurlu
tugberkugurlu / DbGeographyTryOut.cs
Created June 4, 2012 19:51
System.Data.Spatial.DbGeography sample (Latitude and Longitude).
class Program {
public class Db {
public static Dictionary<string, DbGeography> Locations = new Dictionary<string, DbGeography>() {
//instert the place locations here...
};
}