Skip to content

Instantly share code, notes, and snippets.

@folbert
folbert / _display-bootstrap-size.scss
Last active December 29, 2021 17:43
Display current Bootstrap v4 size on screen
/*
Inspired by https://www.viget.com/articles/check-your-breakpoint-using-this-simple-css-snippet
*/
body:after {
color: #000;
font-family: Helvetica;
font-size: 12px;
padding: 5px;
font-weight: bold;
@mlanett
mlanett / rspec_helper.rb
Created September 22, 2014 04:23
Helper to clear redis before/after examples in rspec.
=begin
Include in your rspec config like so:
RSpec.configure do |spec|
spec.include RSpec::RedisHelper, redis: true
end
This helper will clean redis around each example.
=end
@dharamgollapudi
dharamgollapudi / Bench
Created October 12, 2013 23:28 — forked from joaodrp/Bench
(sinatra + thin) vs. goliath
# Simple web service that looks for an image metadata record on a MySQL db given its ID and sends it back in JSON
#
# Ruby 1.9.3
# All gems updated to the most recent version
# MBP i5 8gb Lion
#
# See source code above, combo is:
# Sinatra + Thin:
# - mysql_db.rb # mysql2 api class
# - sinatra_thin_server.rb
@wtaysom
wtaysom / where_is.rb
Created September 23, 2011 08:57
A little Ruby module for finding the source location where class and methods are defined.
module Where
class <<self
attr_accessor :editor
def is_proc(proc)
source_location(proc)
end
def is_method(klass, method_name)
source_location(klass.method(method_name))