Skip to content

Instantly share code, notes, and snippets.

@tomas-stefano
tomas-stefano / Capybara.md
Last active February 5, 2026 20:28
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@BioNuc
BioNuc / Upload image from url via Paperclip.rb
Created January 16, 2013 16:09
Upload image from url using Paperclip
# Basic Code
class Image
has_attached_file :attachment
def attachment_url(url)
require "open-uri"
self.attachment = open(url)
end
end
@bkimble
bkimble / gist:1365005
Last active March 1, 2026 18:43
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []