It's common in Ruby to see some code setup a Struct
like this:
class Specialized < Struct.new(:whatever)
# ... define custom methods here...
end
source "https://rubygems.org" | |
gem "minitest" | |
gem "rspec" |
# Basically the nginx configuration I use at konklone.com. | |
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com | |
# | |
# To provide feedback, please tweet at @konklone or email [email protected]. | |
# Comments on gists don't notify the author. | |
# | |
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites. | |
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration. | |
server { |
# A program that works jobs in newly created UNIX | |
# process by calling fork. The number of processes | |
# running at any given time is bounded by our use | |
# of a sized queue. | |
require 'thread' | |
# Run at most 4 UNIX processes for any given time. | |
@limiter = SizedQueue.new(4) |
What I believe is the most confusing thing for git beginners is that the main commands have multiple uses depending on the arguments or context, and some of those uses aren't well-described by the command's name.
git pull
if Rails.env.development? | |
Rails.application.assets.logger = Logger.new('/dev/null') | |
Rails::Rack::Logger.class_eval do | |
def call_with_quiet_assets(env) | |
previous_level = Rails.logger.level | |
Rails.logger.level = Logger::ERROR if env['PATH_INFO'] =~ %r{^/assets/} | |
call_without_quiet_assets(env) | |
ensure |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.
#!/bin/bash | |
verbose=0 | |
function usage() { | |
echo >&2 "Usage: rbenv each [-v] ..." | |
echo >&2 " -v Verbose mode. Prints a header for each ruby." | |
} | |
while getopts vh option | |
do case "$option" in |
Gem::Specification.new do |s| | |
s.name = "ar_pg_defaults" | |
s.version = "0.0.1" | |
s.platform = Gem::Platform::RUBY | |
s.author = "Nathan Witmer" | |
s.email = "[email protected]" | |
s.homepage = "https://gist.github.com/1262051" | |
s.summary = "Help AR let postgres do its thing" | |
s.description = "Let postgres insert default values for columns with default values that AR 3.1 doesn't understand" |