I hereby claim:
- I am shannonwells on github.
- I am squeedle (https://keybase.io/squeedle) on keybase.
- I have a public key whose fingerprint is 2808 B806 5FDF 578E BB4C 7787 D45A 500A D1C7 74F1
To claim this, I am signing this object:
# Sanity tests for factories and persistence in db | |
# Makes sure you have not inadvertently hosed validation, and suchlike when models are changed | |
shared_examples_for 'a model' do |factory, factory_params = {}| | |
let(:model) { FactoryGirl.build(factory, factory_params) } | |
it 'can be persisted' do | |
expect(model).to be_valid | |
model.save! | |
expect(model).to be_persisted | |
end |
class MyclassBase < ActiveRecord::Base | |
self.abstract_class = true | |
CONFIG_PATH = File.join(Rails.root, 'config', 'database_myclass.yml') unless defined? CONFIG_PATH | |
# So you can use environment variables in your YML file. | |
erb = ERB.new(File.read(CONFIG_PATH)).result | |
config = ActiveSupport::HashWithIndifferentAccess.new(YAML.load(erb))[Rails.env] | |
raise ConfigurationNotFound.new("Configuration not found for config_path: '#{CONFIG_PATH}'") unless config |
require 'mini_portile' | |
# All my notes are tagged with --shannonwells. | |
# I was able to compile platform-specfic gems on OS X Mavericks, AWS-linux AMI and AWS ubuntu AMI. | |
# Please feel free to pm me here or on Twitter (@shannonewells) if you want help --shannonwells | |
# If you're using 0.82, you may have to make a conf file to get it to work. For example: | |
# $ export FREETDSCONF='/opt/local/etc/freetds/freetds.conf' | |
ICONV_VERSION = "1.14" |
ENV['RC_ARCHS'] = '' if RUBY_PLATFORM =~ /darwin/ | |
# :stopdoc: | |
require 'mkmf' | |
# Shamelessly copied from nokogiri | |
# | |
# All my notes are tagged with --shannonwells. |
#!/bin/bash | |
# This script assumes you have already installed the AWS CLI tools and the treehash Ruby gem. | |
VAULT=MyVaultName # AWS Glacier vault name | |
ACCOUNT=123456890 # AWS Account number | |
DIR=$HOME/mydir | |
TREEHASH=/Users/fair/.rvm/gems/ruby-2.2.1/bin/treehash |
SELECT t.name AS table_name, | |
SCHEMA_NAME(schema_id) AS schema_name, | |
c.name AS column_name | |
FROM sys.tables AS t | |
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID | |
WHERE c.name LIKE '%sometext%' | |
ORDER BY schema_name, table_name; |
# https://www.jasondavies.com/maps/random-points/ | |
require 'rspec' | |
require 'awesome_print' | |
class Sphere | |
attr_accessor :radius, :units | |
def initialize(radius=1.0) | |
srand |
I hereby claim:
To claim this, I am signing this object:
cat ~/.bash_profile | |
export EDITOR=vim | |
export CLICOLOR=1 | |
export PS1="\[\033[34m\]\h:\W \[\033[35m\]\$(parse_git_branch)\[\033[00m\]\$(git config user.initials)$\[\033[00m\] " | |
export SUDO_PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[0m\]' | |
export HISTCONTROL=ignoredups; | |
shopt -s histappend; | |
export PROMPT_COMMAND='echo -ne "\033]0;${USER}: ${PWD}\007"' |
#!/bin/bash | |
THISDIR="dirname ${BASH_SOURCE}" | |
echo "Updating your repo." | |
echo "☕️ Take a break - this might take a few minutes." | |
git co development -q | |
git pull origin development --ff-only -q | |
git fetch --prune -q | |
bundle install --quiet | |
yarn install -s |