- Install build-essentials, git-core, vim, mercurial
- Install postgresql-server
- Edit /etc/postgresql/9.1/main/postegresql.conf
- Change
listen_address
to= '*'
- Change
- Edit /etc/postgresql/9.1/main/pg_hba.conf
- Add new line
host all all 10.0.0.0/16 md5
- Add new line
- Add new postgresql superuser named "vagrant" with password "vagrant"
sudo su postgres
createuser -s -W vagrant
- Add postgresql to defaults so it runs at boot
This file contains 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
from django.contrib.admin import FieldListFilter | |
from django.utils.translation import ugettext as _ | |
class ActiveValueFilter(FieldListFilter): | |
"""list_filter which displays only the values for a field which are in use | |
This is handy when a large range has been filtered in some way which means | |
most of the potential values aren't currently in use. This requires a | |
queryset field or annotation named "item_count" to be present so it can |
This file contains 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/source_maps.rb | |
if Rails.env.development? | |
require 'open3' | |
module CoffeeScript | |
class SourceMapError < StandardError; end; | |
class << self | |
def map_dir |
This is how I debug SystemStackError when there is no stack trace.
My first attempt was:
begin
a_method_that_causes_infinite_recursion_in_a_not_obvious_way
rescue SystemStackError
puts caller
end
This file contains 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
maintainer "YOUR_COMPANY_NAME" | |
maintainer_email "YOUR_EMAIL" | |
license "All rights reserved" | |
description "Installs/Configures pants" | |
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) | |
version Time.at(`git --git-dir=#{File.join(File.dirname(__FILE__),'.git')} log --max-count=1 --pretty=format:%ct`.to_i).strftime("1.0.%Y%m%d%H%M") |
This file contains 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
class Chef | |
class ResourceFactory | |
class Rake | |
def self.create(*args, &block) | |
register | |
Chef::Resource::Rake.new(*args, &block) | |
end | |
def self.register | |
@klass ||= begin |
Note: total experiment and hack, looks nasty, could be awesome:
- Drop the
kitchen.local.yml
into$HOME/.kitchen/config.yml
- Install polipo (with Mac:
brew install polipo
, with Ubuntu:apt-get install polipo
) - Drop
polipo-start
andpolipo-console
somewhere useful (perhaps$HOME/bin
?)
This file contains 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 bash | |
# HubCrypt | |
# ======== | |
# | |
# Decrypt a file encrypted using hubencrypt (ok, it's just openssl + rsautl + | |
# your SSH keys). It needs the private key that matches your last public key | |
# listed at github.com/<user>.keys | |
# |
This file contains 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/sh | |
bin_path=/opt/ruby-210/embedded/bin | |
update-alternatives --install /usr/bin/ruby ruby $bin_path/ruby 10 \ | |
--slave /usr/bin/irb irb $bin_path/irb \ | |
--slave /usr/bin/erb erb $bin_path/erb \ | |
--slave /usr/bin/rdoc rdoc $bin_path/rdoc \ | |
--slave /usr/bin/ri ri $bin_path/ri \ | |
--slave /usr/bin/testrb testrb $bin_path/testrb \ |
by 0xabad1dea, December 2014
This document is an RFC of sorts for increasing the adoption rate of Singular They in technical English. This is not an ultimatum; this is not shaming anyone who has done otherwise; and this is definitely not applicable to any other language.