Install chef gem (for knife
command):
gem install chef
knife cookbook create my_cookbook
# -*- encoding: utf-8 -*- | |
$:.unshift '.' | |
require 'bsearch' | |
Gem::Specification.new do |s| | |
s.name = 'bsearch-ruby' | |
s.version = BSearch::VERSION | |
s.authors = ["Aaron Suggs"] | |
s.description = "A binary search implementation in ruby" |
# NB: `req` is a Rack::Request object (basically an env hash with friendly accessor methods) | |
# Throttle 10 requests/ip/second | |
# NB: return value of block is key name for counter | |
# falsy values bypass throttling | |
Rack::Attack.throttle("req/ip", :limit => 10, :period => 1.second) { |req| req.ip } | |
# Block cloud IPs from accessing PATH regexp | |
Rack::Attack.block "bad_ips from logging in" do |req| |
From 233f504a39aca6e8b2d9332ef324b4c5cc397eca Mon Sep 17 00:00:00 2001 | |
From: Aaron Suggs <[email protected]> | |
Date: Fri, 6 Apr 2012 18:35:38 -0400 | |
Subject: [PATCH 1/2] Whitespace: tabs to spaces | |
--- | |
examples/init.sh | 90 +++++++++++++++++++++++++++--------------------------- | |
1 files changed, 45 insertions(+), 45 deletions(-) | |
diff --git a/examples/init.sh b/examples/init.sh |
From 130b610b4e67bcad522a268f1d3f221e8d12ebb0 Mon Sep 17 00:00:00 2001 | |
From: Aaron Suggs <[email protected]> | |
Date: Fri, 6 Apr 2012 18:35:38 -0400 | |
Subject: [PATCH 1/2] Whitespace: tabs to spaces | |
--- | |
examples/init.sh | 90 +++++++++++++++++++++++++++--------------------------- | |
1 file changed, 45 insertions(+), 45 deletions(-) | |
diff --git a/examples/init.sh b/examples/init.sh |
Gem::Specification.new do |s| | |
s.name = 'bang' | |
s.version = '0.1.0' | |
s.platform = Gem::Platform::RUBY | |
s.author = 'Jeff Kreeftmeijer' | |
s.email = '[email protected]' | |
s.summary = 'Bang!' | |
s.description = 'Bangs existing model methods' | |
s.files = ['bang.rb'] |
require 'term/ansicolor' | |
# yeilds a stacktrace for each SQL query | |
# put this file in config/initializers | |
class QueryTrace < ActiveSupport::LogSubscriber | |
include Term::ANSIColor | |
attr_accessor :trace_queries | |
def sql(event) #:nodoc: | |
return unless QueryTrace.enabled? && logger.debug? && Rails.env.development? |
module Enumerable | |
def pluck(key) | |
map {|obj| obj[key] } | |
end | |
end |
Did you upgrade to rails 3 yet? | |
I made a rake task for that. | |
1.8.7, or 1.9.3? | |
Did you know there's a rake task for that? | |
Did you upgrade to rails 3.1 yet? | |
Did you see my pull request? | |
Did you upgrade to rails 3.2 yet? | |
I commented on your pull request. | |
You need to run bundle install first | |
rb-env or rvm? |
Gem::Specification.new do |s| | |
s.name = 'git_io' | |
s.version = '1.0.0' | |
s.platform = Gem::Platform::RUBY | |
s.author = 'Aaron Suggs' | |
s.email = '[email protected]' | |
s.summary = 'Shorten urls with git.io' | |
s.description = 'GitIo.shorten(url)' | |
s.homepage = 'https://gist.github.com/1762136' |