JSON
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
python-pip: | |
pkg.installed | |
docker-py: | |
pip.installed: | |
- require: | |
- pkg: python-pip | |
# TODO: ensure docker-py is declared a requirement for all dockerio states without having to explicitely declare the requirement in each container state again |
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 Beastiary of Badassery | |
- | |
SQLisms | |
-- | |
WITH | |
arrays and unnest | |
window functions | |
JSON | |
row types |
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
class ActiveRecord::Base | |
mattr_accessor :shared_connection | |
@@shared_connection = nil | |
def self.connection | |
@@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection } | |
end | |
end | |
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection |
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
require 'strscan' | |
module UTF8Util | |
HIGH_BIT_RANGE = /[\x80-\xff]/n | |
ENCODING_SUPPORT = "".respond_to?(:force_encoding) | |
REPLACEMENT = "?" | |
# Check if this String is valid UTF-8 | |
# |
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 | |
#this will mirror a website, upload to s3, and make it publically available. | |
#install s3cmd. install wget. (i use homebrew). | |
#configure s3cmd (s3cmd --configure) | |
# run this by doing: mirror_site.sh www.example.org | |
wget --mirror -p --html-extension --convert-links -e robots=off -P . $1 | |
s3cmd mb s3://$1 |