Skip to content

Instantly share code, notes, and snippets.

@fny
fny / assets.rb
Created July 8, 2015 01:09
Dry Up Your Initializers with #tap
# Before
Rails.application.config.assets.version = '1.0'
Rails.application.config.assets.paths << Emoji.images_path
Rails.application.config.assets.precompile += %w( search.js )
# After
Rails.application.config.assets.tap do |assets|
assets.version = '1.0'
assets.paths << Emoji.images_path
assets.precompile += %w( search.js )
@gabehollombe
gabehollombe / similar_lines.rb
Created December 6, 2013 01:26
A simple Ruby script to calculate the percentage of similar lines between files. Useful for seeing duplicated lines in rails view files, for example.
# Show the percentage of similar lines between files.
# Requires: diffy gem
# Usage: Edit line 33 to match the files you're interested in, then run this script.
require 'rubygems'
require 'diffy'
def get_dup_lines_percentage(file1, file2)
starts_with_minus = /^-.*/
@holman
holman / gemspec-usage.md
Created February 12, 2012 07:02
test/spec/mini

Just install this in your apps like so:

gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'

@amyjenkins
amyjenkins / gist:654849
Created October 30, 2010 02:45
adding my notes to edavis10 notes

(fork of https://gist.github.com/aaa08856822a85a6864b (but gist fork is broken :-/ ))

Infoproducts Show and Tell hosted by Kelly Parkinson and Amy Hoy

Infoproducts---> something that teaches, helps you learn, transforms your mind, works with you (not for you). Can be part of your own process, can be part of your website so people can do their own.

  • ebooks---solve some kind of problem, share some kind of knowledge
    • 37s sold a $400 ecommerce store design booklet
  • screencasts---animating things
@mislav
mislav / _notes.md
Created July 21, 2010 18:25
"livereload" server replacement for working with Rails

A replacement for "livereload" gem on OS X

This script is a replacement for livereload server component designed for working with Rails. It watches the filesystem with FS Events (Mac OS X) rather than with EventMachine. This is better for large projects for wich EventMachine fails with "too many open files" exception.

Sass is supported; .sass files can also be stored in "app/styles/" directory. Compass is detected if "config/compass.rb" file exists.

Installation:

Download this script to somewhere in your PATH and make it executable. You can name it something different than "livereload" if you want to try this and the official gem executable in parallel.