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
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" |
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
#!/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 |
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.
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
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 |
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.
- merges together different branches (different histories, to be more exact)
- fast-forwards if a merge isn't necessary; effectively repositioning the branch head to a descendant commit
- unwanted outcome of
git pull
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
# 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) |
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
# 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 { |
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
source "https://rubygems.org" | |
gem "minitest" | |
gem "rspec" |