In test/test_helper.rb...
### Bullet (N+1 queries)
if ENV['BULLET']
Bullet.enable = true
require 'minitest/unit'In test/test_helper.rb...
### Bullet (N+1 queries)
if ENV['BULLET']
Bullet.enable = true
require 'minitest/unit'| # Delete prior revisions from a GitHub wiki so that only the most-recent | |
| # version of the content is available. | |
| # Clone the wiki. | |
| git clone https://github.com/[user]/[repo].wiki.git | |
| # Remove the .git folder. | |
| rm -rf .git | |
| # Reconstruct the local repo with only latest content |
| # Video of it in action: http://cl.ly/VSIF | |
| class MyScene < SKScene | |
| def scroll_action(x, duration) | |
| width = (x * 2) | |
| move = SKAction.moveByX(-width, y: 0, duration: duration * width) | |
| reset = SKAction.moveByX(width, y: 0, duration: 0) | |
| SKAction.repeatActionForever(SKAction.sequence([move, reset])) | |
| end |
| #!/usr/bin/env ruby | |
| # | |
| # CHANGELOG generator | |
| # | |
| # Usage: | |
| # | |
| # $ changelog [SINCE UNTIL] | |
| # | |
| # This script collects git commits from a given range (SINCE and UNTIL | |
| # are optional refs, SINCE defaults to the last tag, UNTIL to HEAD). |
| require 'simplecov' | |
| SimpleCov.command_name "acceptance" | |
| ENV["RAILS_ENV"] ||= 'test' | |
| require File.expand_path("../../config/environment", __FILE__) | |
| require 'rspec/rails' | |
| require 'rspec/autorun' | |
| require 'capybara/rails' | |
| require 'capybara/poltergeist' |
Updated for Rails 4.0.0+
Set up the bower gem.
Follow the Bower instructions and list your dependencies in your bower.json, e.g.
// bower.json{
| diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb | |
| index e948314..a24b35a 100644 | |
| --- a/activesupport/lib/active_support/callbacks.rb | |
| +++ b/activesupport/lib/active_support/callbacks.rb | |
| @@ -321,7 +321,13 @@ module ActiveSupport | |
| _normalize_legacy_filter(kind, filter) | |
| scopes = Array(chain.config[:scope]) | |
| - method_to_call = scopes.map{ |s| s.is_a?(Symbol) ? send(s) : s }.join("_") | |
| + method_to_call = scopes.map { |s| |
As GitHub does not include a message when answering my questions I decided to keep track of them myself, this is container gist for my questions and all the answers I get.
Most of the issues are for RVM to make my life easier.
| #!/bin/sh | |
| file "$1" | grep -q "text" | |
| if [ $? -ne 0 ]; then | |
| /usr/bin/open $1 | |
| else | |
| /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl $1:$2 | |
| fi |
| #!/usr/bin/env ruby | |
| require 'logger' | |
| # rotatelogs required... | |
| # http://httpd.apache.org/docs/2.2/programs/rotatelogs.html | |
| logger = Logger.new("|rotatelogs ./foo.log.%Y-%m-%d-%H 3600", 0, 0) | |
| 10.times do | |
| logger.error "testing..." |