Skip to content

Instantly share code, notes, and snippets.

@leesmith
leesmith / gist:3094856
Created July 12, 2012 00:52 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@leesmith
leesmith / restore-into-local-db.txt
Created August 16, 2012 18:58
Restore heroku pg database to local pg database
# View backups and pick one to pull down
heroku pgbackups
# Download chosen backup
curl -o my_backup.dump `heroku pgbackups:url <backup_num>`
# Restore into local database
pg_restore --verbose --clean --no-acl --no-owner -h myhost -U myuser -d mydb my_backup.dump
@leesmith
leesmith / dump.txt
Created October 27, 2012 01:08
Mysqldump and gzip one-liner
mysqldump db_name -u root -p | gzip -c | cat > db_name.sql.gz
@leesmith
leesmith / setup.md
Last active October 13, 2015 14:48
Ruby development setup on OSX Mountain Lion from scratch

Ruby development setup on OSX Mountain Lion from scratch

Install Xcode from app store

Install Xcode command line tools from the "Xcode > Preferences > Downloads" menu

Generate ssh key & copy to github

ssh-keygen -t rsa -C "your.email@example.com"
@leesmith
leesmith / exercise-schedule.md
Last active December 11, 2015 21:49
Strength training workout program

Strength Training

Directions

Frequency

Perform workout three times per week, resting at least a day between sessions. One cycle lasts 6 weeks followed by a week of rest.

Time needed

@leesmith
leesmith / browserpad.txt
Created January 30, 2013 23:08
Notepad in a browser
data:text/html;charset=utf-8, <title>TextEditor</title> <link rel="shortcut icon" href="http://g.etfv.co/https://docs.google.com"/> <style> html{height: 100%;} body{background: -webkit-linear-gradient(#f0f0f0, #fff); padding: 3%; height: 94%;} .paper { font: normal 12px/1.5 "Lucida Grande", arial, sans-serif; width: 50%; height: 80%; margin: 0 auto; padding: 6px 5px 4px 42px; position: relative; color: #444; line-height: 20px; border: 1px solid #d2d2d2; background: #fff; background: -webkit-gradient(linear, 0 0, 0 100%, from(#d9eaf3), color-stop(4%, #fff)) 0 4px; background: -webkit-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -moz-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -ms-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -o-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; -webkit-background-size: 100% 20px; -moz-background-size: 100% 20px; -ms-background-size: 100% 20px; -o-background-size: 100% 20p
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS
@leesmith
leesmith / import-csv-excel.txt
Created February 25, 2013 15:09
Import CSV into Excel
1. Download the file
2. Find the downloaded file on your computer and rename it so that it ends with the letters ".txt" rather than ".csv"
3. In Excel, click File -> Open, then locate and select the downloaded and renamed file. An "import" dialog will open.
4. During the import process, designate that the file is "Delimited" with a "Comma", and that the "File Origin" is set to UTF-8.
5. Click "Finish"
@leesmith
leesmith / ie-vm-scripts.md
Last active December 16, 2015 07:09
VirtualBox Internet Explorer VM's

Download VirtualBox

Install ALL versions of Internet Explorer: IE7, IE 8, and IE 9

curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | bash

Install individual IE VM (7-10)

@leesmith
leesmith / hdd-to-ssd
Created August 1, 2013 18:56
HDD to SSD upgrade for Macbook Pro
http://thetechblock.com/upgrading-macbook-pro-ssd-superduper/
When I first purchased my MacBook Pro in early 2012 (13” unibody), I purchased it with the base specs. After considering Apple’s upcharge on upgrading individual components, I realized it was significantly cheaper to buy the MBP with a 320GB HD and 4GB RAM and then upgrade everything myself. 128GB SSD and 8GB RAM later (which is much cheaper now than it was then), my laptop was a freaking workhorse. The single biggest upgrade in performance was, by far, the SSD.
At the time, I couldn’t convince myself to spring for the 256GB drive, mostly because the price for the drive was around $450. Needless to say, prices have dropped. A lot. With 50GB of music taking a big chunk of my hard drive space, I was getting tired of having to move media off to external drives. I decided that it was time to upgrade. Again.
I took a long, hard look at the Optibay, which allows users to install a hard drive into their optical bays. In fact, I actually went so far as