Skip to content

Instantly share code, notes, and snippets.

View dougjohnston's full-sized avatar

Doug Johnston dougjohnston

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 }
@chitoku-k
chitoku-k / .travis.linux.yml
Last active September 2, 2022 06:33
ChromeDriver on Travis CI
os: linux
node_js: '12'
sudo: required
env: DISPLAY=':99.0'
dist: trusty
addons:
apt:
update: true
sources:
- google-chrome
@colintoh
colintoh / table.css
Created October 27, 2014 05:42
Table CSS
table { display: table }
tr { display: table-row }
thead { display: table-header-group }
tbody { display: table-row-group }
tfoot { display: table-footer-group }
col { display: table-column }
colgroup { display: table-column-group }
td, th { display: table-cell }
caption { display: table-caption }
@robert-b-clarke
robert-b-clarke / gist:7872713
Last active December 30, 2015 19:09
Being invited to try "Circle - The local network" didn't just make me angry, it made me think about a lot other stuff.

It's been 3 months since I launched the proof of concept for LampNote, my platform for sharing and discovering local information. During that time it's become apparent that in its present form the site is unlikely to achieve the kind of exponential growth that will result in it becoming “the next big thing”, though it has achieved some modest success reuniting missing cats with their owners.

Since LampNote went live I've come across several sites and mobile apps which endeavour to accomplish something similar. That doesn't usually bother me. “Tell my neighbours about X” and “what's happening at Y” are still problems that haven't really been solved using the internet. It's no surprise that other people are trying their own approach with varying degrees of funding, traction and quality. Something odd happened yesterday though. I was invited via a Facebook notification to join Circle “the local network”. As I researched Circle I was simultaneously appalled and amazed, for this was a prod

@jjb
jjb / gist:7389552
Last active March 16, 2024 18:48
Ruby 2.1 memory configuration

This all applies to Ruby 2.1. In some cases a setting is not available in 2.0, this is noted. There is also a different with 1.9, 1.8, and REE --- these are not noted.

All the relevant code is in https://github.com/ruby/ruby/blob/master/gc.c

RUBY_HEAP_MIN_SLOTS

default: 10000

The number of heap slots to start out with. This should be set high enough so that your app has enough or almost enough memory after loading so that it doesn't have to allocate more memory on the first request (althogh this probably isn't such a big deal for most apps).

(todo: figure out how big a slot is. i think the answer can be infered from this code.)

@travismillerweb
travismillerweb / scroll-shadow.css
Created September 23, 2013 18:57
CSS - Google Scroll Shadow
/*
Gmail/Google Reader Sidebar Scroll Shadows
-------------------------------------------
Neat effect that mimics the scroll shadows that appear in the GOogle sitde bar and visually cues users to scroll up or down depending on their position.
Credit goes to Lea Verou for this awesome find.
Source:
Lea's Talk: http://www.youtube.com/watch?v=3ikye7Qc7Ak
Code Source: http://lea.verou.me/more-css-secrets/#slide9
@javan
javan / gist:1168475
Created August 24, 2011 16:32
Fix iPhone home button
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/
1.) Open any application
2.) Press and hold the power button until the slide to shutdown swipe bar appears.
3.) Release Power button
4.) Press and hold Home button Lightly
until screen returns to icon screen
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')