Skip to content

Instantly share code, notes, and snippets.

module Gretel
class << self
include Resettable
# Returns the path from with breadcrumbs are loaded. Default is +config/breadcrumbs.rb+
# in the app and all loaded engines. Breadcrumbs set in the app will override
# breadcrumbs set in engines.
def breadcrumb_paths
@breadcrumb_paths ||= begin
engine_roots = Rails::Application::Railties.engines.map { |e| e.config.root }
@mattallen
mattallen / gist:9282691
Created March 1, 2014 00:18
keybase.md
### Keybase proof
I hereby claim:
* I am mattallen on github.
* I am matta (https://keybase.io/matta) on keybase.
* I have a public key whose fingerprint is A456 F2B3 008B D3FA C4E4 F490 8AB6 0D37 C745 8134
To claim this, I am signing this object:
4531 packets transmitted, 3233 packets received, 28.6% packet loss
round-trip min/avg/max/stddev = 16.927/25396.487/162211.051/41768.166 ms
@mattallen
mattallen / gist:6616283
Created September 18, 2013 21:51
Ping results from Macarthur to Central on 6:48am train
3885 packets transmitted, 3787 packets received, +1 duplicates, 2.5% packet loss
round-trip min/avg/max/stddev = 18.762/7228.543/108513.193/17872.616 ms
@mattallen
mattallen / gist:1787748
Created February 10, 2012 08:14 — forked from dx7/gist:1333785
Installing ruby-debug with ruby-1.9.3-p0
# Install with:
# bash < <(curl -L https://raw.github.com/gist/1333785)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p0 ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
@mattallen
mattallen / gist:1392604
Created November 25, 2011 01:20
ActiveRecord::AssociationTypeMismatch in Admin::UsersController#update
ActiveRecord::AssociationTypeMismatch in Admin::UsersController#update
Channel(#2159242420) expected, got Channel(#2169779660)
only happens in dev, goes away if "config.cache_classes = true"
ruby-1.9.2-p290 :009 > r = Record.where(:e => "x")
Record Load (42.8ms) SELECT "records".* FROM "records" WHERE "records"."e" = 'x'
=> []
ruby-1.9.2-p290 :010 > r.class
=> ActiveRecord::Relation
ruby-1.9.2-p290 :011 > r.where(:c => "y")
Record Load (41.3ms) SELECT "records".* FROM "records" WHERE "records"."e" = 'x' AND "records"."c" = 'y'
=> []
ruby-1.9.2-p290 :012 >
@mattallen
mattallen / gist:1070924
Created July 8, 2011 01:36
Mailplane Custom CSS
.mq {
display:none;
}
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Locking environment
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `initialize': not in gzip format (Zlib::GzipFile::Error)
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `new'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `initialize'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:63:in `each'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:54:in `loop'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:54:in `each'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:32:in `initialize'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:17:in `new'
@mattallen
mattallen / mysqlbackup.rb
Created March 6, 2009 06:19
Puts your Mysql dumps into a git repo and pushes it offsite
#!/usr/bin/env ruby
################
#
# Put this script in your path and make it executable i.e ~/bin then chmod 755 mysqlbackup.rb
#
# 1. Create your repo (mkdir /path/to/repo && cd /path/to/repo && git init)
# 2. Setup the remote server (ssh user@remote "mkdir mysql_back.git" && cd mysql_back.git && git init")
# 3. Setup the remote (git remote add origin ssh://user@remote/home/user/mysql_back.git)
# 4. run mysqlbackup.rb