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
#CAPTURE NEW: rails db:restore_from_production\[capture\] | |
#DOWNLOAD LATEST: rails db:restore_from_production\[download\] | |
#RESTORE: rails db:restore_from_production | |
#[HEROKU_APP_NAME] = Name of your heroku app. | |
#[NUMBER_OF_CORES] = Number of concurrent jobs to run for pg_restore. | |
namespace :db do | |
desc 'Pull down the latest backup from Heroku and rebuild your local database with it.' | |
task :restore_from_production, [:process] => :environment do |task, args| |
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
# this forces dpkg not to call sync() after package extraction and speeds up install | |
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup | |
# we don't need and apt cache in a container | |
RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache |
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 "sinatra/base" | |
require "sinatra/namespace" | |
require "multi_json" | |
require "api/authentication" | |
require "api/error_handling" | |
require "api/pagination" | |
module Api | |
class Base < ::Sinatra::Base |
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
Navigation: | |
cmd-p Goto Anything ('@' for functions, ':' for line number) | |
cmd-r Function finder | |
ctl-g Goto line number | |
cmd-sft-p Command palette | |
cmd-sft-f Find in Files | |
cmd-opt-r Toggle regex when finding | |
cmd-opt-# Columns | |
ctr-# Switch columns |
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
var simpleFormatRE1 = /\r\n?/g; | |
var simpleFormatRE2 = /\n\n+/g; | |
var simpleFormatRE3 = /([^\n]\n)(?=[^\n])/g; | |
function simpleFormat(str) { | |
var fstr = str; | |
fstr = fstr.replace(simpleFormatRE1, "\n") // \r\n and \r -> \n | |
fstr = fstr.replace(simpleFormatRE2, "</p>\n\n<p>") // 2+ newline -> paragraph | |
fstr = fstr.replace(simpleFormatRE3, "$1<br/>") // 1 newline -> br | |
fstr = "<p>" + fstr + "</p>"; | |
return fstr; |
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 | |
############################################################################ | |
# Script to open a directory in TextMate excluding certain directories that | |
# tend to slow down the Find in Project... function. | |
# | |
# Place in an executable loctation with a name of your choosing. | |
# I use `ate' and have it in ~/Local/bin (which has been added to $PATH) | |
############################################################################ |
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
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html | |
Hi everyone, I'm Chris Wanstrath. | |
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But | |
then I took a few moments and thought, Wait, why? Why me? What am I supposed | |
to say that's interesting? Something about Ruby, perhaps. Maybe the | |
future of it. The future of something, at least. That sounds | |
keynote-y. | |