Skip to content

Instantly share code, notes, and snippets.

@KevinTriplett
KevinTriplett / capybara_wait_until.rb
Last active December 14, 2015 12:38
Adding back the #wait_until to Capybara v2+ gem. Can probably be adapted for cucumber tests.
# add this file capybara_wait_until.rb to your /test directory
module Capybara
class Session
##
#
# Retry executing the block until a truthy result is returned or the timeout time is exceeded
#
# @param [Integer] timeout The amount of seconds to retry executing the given block
#
@mikeyk
mikeyk / gist:1329319
Created October 31, 2011 22:56
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
<% if flash[:error].present? %>
<h3><%= flash[:error] %></h3>
<% else %>
<div id="fb-root"></div>
<div id="error-message"></div>
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : "<%= Facebook::CONFIG['app_id'] %>",