This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| syntax on | |
| set nocompatible | |
| set autoindent | |
| set expandtab | |
| set tabstop=2 | |
| set shiftwidth=2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # desktopography-dl.rb | |
| # Requires: nokogiri | |
| # | |
| # Downloads /everything/ from a given Desktopography exhibition. Assumes we're on | |
| # something unixy, with mkdir and wget available for use. | |
| require 'open-uri' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| guard 'bundler' do | |
| watch('Gemfile') | |
| # Uncomment next line if Gemfile contain `gemspec' command | |
| # watch(/^.+\.gemspec/) | |
| end | |
| guard 'rails' do | |
| watch('Gemfile.lock') | |
| watch(%r{^(config|lib)/.*}) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module DistantCounters | |
| extend ActiveSupport::Concern | |
| included do | |
| reflect_on_all_associations.each do |reflection| | |
| next unless reflection.macro == :has_many and reflection.is_a? ActiveRecord::Reflection::ThroughReflection | |
| next unless reflection.klass.column_names.include? "#{name.underscore.pluralize}_count" | |
| assoc_name = reflection.name.to_s.singularize | |
| redefine_method "#{assoc_name}_ids=" do |ids| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # config/initializers/will_paginate.rb | |
| module WillPaginate | |
| module ActionView | |
| def will_paginate(collection = nil, options = {}) | |
| options[:renderer] ||= BootstrapLinkRenderer | |
| super.try :html_safe | |
| end | |
| class BootstrapLinkRenderer < LinkRenderer |
NewerOlder