Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
redis_version=2.6.11
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.github.com/jasonayre/5506542/raw/bafca63f0ee08d19ad6f4c6ba131262e086a218c/install-redis.sh
# chmod +x install-redis.sh
# ./install-redis.sh
@jasonayre
jasonayre / application.rb
Created May 3, 2014 20:07
Rails Dynamic Subdomain Constraint / Store Example
and dont forget
config.eager_load_paths << Rails.root.join('lib')
require 'nokogiri'
require 'open-uri'
### Quick little script to parse all the colors form
### http://www.google.com/design/spec/style/color.html
### and write scss file
class GoogleColorParser
def initialize
sorted_colors
class EnableExtensions < ActiveRecord::Migration
def self.up
execute "CREATE EXTENSION \"uuid-ossp\";"
end
def self.down
execute "DROP EXTENSION \"uuid-ossp\";"
end
end
def self.mounted_path_for_engine(engine_klass)
route = ::Rails.application.routes.routes.detect do |route|
route.instance_variable_get("@app").instance_variable_get("@app") == engine_klass
end
route && route.instance_variable_get("@path_formatter").instance_variable_get("@parts").join("")
end
@jasonayre
jasonayre / reporting_apiengine
Created February 20, 2015 21:47
mounted_routes_for_engine
module ReportingApi
class Engine < ::Rails::Engine
isolate_namespace ReportingApi
::Dir[root.join('app', 'controllers', 'reporting_api', 'concerns', '*.rb')].each do |file|
require file
end
initializer "reporting_api.routes" do
::ActiveSupport.on_load(:after_engines_mounted) do |klass|
Exception `LoadError' at /Users/jasonayre/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems.rb:1222 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /Users/jasonayre/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems.rb:1231 - cannot load such file -- rubygems/defaults/ruby
Exception `Errno::EEXIST' at /Users/jasonayre/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/fileutils.rb:252 - File exists @ dir_s_mkdir - /Users/jasonayre/.rvm/gems/ruby-2.2.0
Exception `LoadError' at /Users/jasonayre/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/resolv.rb:168 - LoadError
Exception `NoMethodError' at /Users/jasonayre/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.3/lib/bundler/dep_proxy.rb:39 - undefined method `to_ary' for #<Gem::Dependency:0x007f8e23878670>
Exception `NoMethodError' at /Users/jasonayre/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.3/lib/bundler/dep_proxy.rb:39 - undefined method `to_ary' for #<Gem::Dependency:0x007f8e23878238>
Exception `NoMethodError' at /Users/jasonayre/.rvm/gems/ruby-2.2.0/gems/bundl
Exception `LoadError' at /Users/jasonayre/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems.rb:1222 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /Users/jasonayre/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems.rb:1231 - cannot load such file -- rubygems/defaults/ruby
Exception `Errno::EEXIST' at /Users/jasonayre/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/fileutils.rb:252 - File exists @ dir_s_mkdir - /Users/jasonayre/.rvm/gems/ruby-2.2.0
Exception `LoadError' at /Users/jasonayre/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/resolv.rb:168 - LoadError
Exception `Errno::ENOENT' at /Users/jasonayre/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/specification.rb:2716 - No such file or directory @ rb_file_s_stat - lib/trax/core/struct.rb
Exception `NoMethodError' at /Users/jasonayre/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.3/lib/bundler/dep_proxy.rb:39 - undefined method `to_ary' for #<Gem::Dependency:0x007fe84d099268>
Exception `NoMethodError' at /Users/jasonayre/.rvm/gems/ruby-2.2.0/gems/bu
@jasonayre
jasonayre / gist:73c898a11cdee3243072
Created June 5, 2015 15:50
rspec/trace backtracke
Exception `LoadError' at /Users/jasonayre/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems.rb:1222 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /Users/jasonayre/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems.rb:1231 - cannot load such file -- rubygems/defaults/ruby
Exception `Errno::EEXIST' at /Users/jasonayre/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/fileutils.rb:252 - File exists @ dir_s_mkdir - /Users/jasonayre/.rvm/gems/ruby-2.2.1
Exception `LoadError' at /Users/jasonayre/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/resolv.rb:168 - LoadError
Exception `NoMethodError' at /Users/jasonayre/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.3/lib/bundler/dep_proxy.rb:39 - undefined method `to_ary' for #<Gem::Dependency:0x007f8d6d04edc0>
Exception `NoMethodError' at /Users/jasonayre/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.3/lib/bundler/dep_proxy.rb:39 - undefined method `to_ary' for #<Gem::Dependency:0x007f8d6d04e9d8>
Exception `NoMethodError' at /Users/jasonayre/.rvm/gems/r
#!bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#