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
task :deploy do | |
system 'jekyll && rsync -avz --delete -e ssh _site/ ck:blog.corykaufman.com && git push origin master' | |
end |
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
# lib/tasks/db/sample.rake | |
namespace :db do | |
desc "Clear out the database and replace it with sample data" | |
task :sample => ['db:ensure_development_or_staging','environment','db:drop','db:setup'] do | |
sample_file = 'db/samples.rb' | |
load(sample_file) if File.exists?(sample_file) | |
end | |
task :ensure_development_or_staging do |
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
# lib/tasks/deploy.rake | |
namespace :deploy do | |
desc 'Deploy to production' | |
task(:production) { deploy } | |
desc 'Deploy to staging' | |
task(:staging) { deploy :staging } | |
private |
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
# /etc/nginx/sites-available/sitename.com | |
server { | |
listen 443 ssl; | |
server_name *.sitename.com; | |
keepalive_timeout 70; | |
ssl on; | |
ssl_certificate /etc/ssl/certs/sitename-bundle.crt; | |
ssl_certificate_key /etc/ssl/private/sitename.key; | |
root /var/www/sitename.com/public; |
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
module Centsify | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def centsify(*columns) | |
columns = [columns] unless columns.is_a?(Array) | |
columns.each do |column| | |
define_method column do | |
self.send("#{column}_cents").to_i / 100.0 | |
end |
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
#!/usr/bin/env ruby | |
# | |
# Bookmarkletize is a lil script to turn a normal javascript file into a | |
# (virtually unreadable) URL-escaped string that can be used in a | |
# bookmarklet. | |
# | |
# Inspiration: http://daringfireball.net/2007/03/javascript_bookmarklet_builder | |
# | |
# I could use his script, but come on. It's perl. |
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 : http://marc-bowes.com/2011/09/21/dry-your-bundle-exec-tears.html | |
# | |
# Add to ~/.bash_profile or ~/.bashrc | |
bundle_commands="rake rails unicorn" | |
function run_bundler_cmd () { | |
if [ -r ./Gemfile ]; then | |
bundle exec $@ | |
else |
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
<script> | |
(function() { | |
var ts = document.createElement('script'), | |
s = document.getElementsByTagName('script')[0]; | |
ts.type = 'text/javascript'; | |
ts.async = true; | |
ts.src = 'http://townstage:3000/assets/widgets.js'; | |
s.parentNode.insertBefore(ts, s); | |
})(); | |
</script> |
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 -l | |
export RACK_ENV="production" | |
export RAILS_ENV="production" | |
APP_PATH=/var/www/townstage | |
CURRENT="$APP_PATH/releases/$(date +"%Y%m%d%H%M")" | |
exit_with_error() { | |
echo "Error..." |
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
autocmd InsertEnter * syn clear EOLWS | syn match EOLWS excludenl /\s\+\%#\@!$/ | |
autocmd InsertLeave * syn clear EOLWS | syn match EOLWS excludenl /\s\+$/ | |
highlight EOLWS ctermbg=red guibg=red |
OlderNewer