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
<div class='posts'> | |
<ul class='posts'> |
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
require 'rubygems' | |
require 'sinatra' | |
set :public, Proc.new { File.join(root, "_site") } | |
# This before filter ensures that your pages are only ever served | |
# once (per deploy) by Sinatra, and then by Varnish after that | |
before do | |
response.headers['Cache-Control'] = 'public, max-age=31557600' # 1 year | |
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
# Neat litle sinatra app that allows hosting of static sites | |
# on heroku. I don't remember where I found this, but thanks | |
# if you're out there. | |
require 'rubygems' | |
require 'sinatra' | |
set :public, Proc.new { File.join(root, "_site") } | |
# This before filter ensures that your pages are only ever served | |
# once (per deploy) by Sinatra, and then by Varnish after that |
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
:markdown | |
# #{underwriter_initials} Adverse Action Letter | |
#### #{notice_date} | |
#### #{first_name} #{last_name} | |
#### #{applicant_address_1} | |
#### #{applicant_address_2} | |
#### #{applicant_city}, #{applicant_state} #{applicant_zip} | |
Dear Applicant: |
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
# I want this method in ruby-core | |
def let | |
yield | |
end | |
def fib(i) | |
let do |n = 1, result = 0| | |
if i == -1 | |
result | |
else |
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 Hash | |
# Return a new hash with all keys converted to camelcase | |
def camelize_keys | |
dup.camelize_keys! | |
end | |
# Destructively convert all keys to camelcase | |
def camelize_keys! | |
keys.each do |key| |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# don't overwrite GNU Midnight Commander's setting of `ignorespace'. | |
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups |
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
#directory stuff | |
alias la='ls -a' | |
alias ll='ls -l' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' | |
alias .....='cd ../../../..' | |
alias ......='cd ../../../../..' | |
alias .......='cd ../../../../../..' | |
alias ~='cd ~' |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function elite | |
{ | |
local GRAY="\[\033[1;30m\]" | |
local LIGHT_GRAY="\[\033[0;37m\]" | |
local CYAN="\[\033[0;36m\]" |
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
# **Whereabouts** is a Rails plugin that generates a polymorphic, inheritable | |
# Address model. Install it as a Rails plugin (Rails 3.x+ required) | |
# | |
# rails plugin install http://github.com/yrgoldteeth/whereabouts.git | |
# | |
# The most simple use case creates a has_one relationship with | |
# a generic Address: | |
# | |
# class Foo < ActiveRecord::Base | |
# has_whereabouts |