Skip to content

Instantly share code, notes, and snippets.

@dashed
dashed / github-pandoc.css
Created September 26, 2013 13:42
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@stevenklise
stevenklise / app.rb
Created April 18, 2013 19:34
Using `irb` to connect to a Sinatra app or DataMapper connection
# require basic libraries
source 'https://rubygems.org'
require 'rubygems'
require 'sinatra'
require 'data_mapper'
# require DataMapper adapter, in this case we'll use Postgres
require 'dm-postgres-adapter'
DataMapper.setup(:default, ENV['DATABASE_URL'])
@parameme
parameme / serializable_sha1_using_ffi.rb
Created April 2, 2012 04:22
Quick and dirty way to serialize and restore ruby Digest::SHA1 using FFI
require 'ffi'
require 'digest'
# Thanks to all ruby hackers everywhere who have donated their knowledge to the commons!
# With thanks to @judofyr for ffi/"evil.rb" - https://gist.github.com/2238438
class Object
def memory_location
object_id * 2
end
@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')