Skip to content

Instantly share code, notes, and snippets.

@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 / pre-commit
Created May 20, 2013 16:22
Git pre-commit hook to search for bad things in a commit
#!/bin/sh
if git-rev-parse --verify HEAD >/dev/null 2>&1; then
against=HEAD
else
# run against initial commit
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
for FILE in `git diff-index --check --name-status $against -- | cut -c3-` ; do
@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
@leesmith
leesmith / bootable-usb.md
Last active July 9, 2020 05:13
Create a bootable macOS USB drive

Create A Bootable macOS USB Drive

http://support.apple.com/kb/HT5856?viewlocale=en_US&locale=en_US

  1. Download the macOS installer from the Mac App Store and make sure it's in your main Applications folder.

  2. Connect a properly formatted 8GB (or larger) drive. Rename the drive to Untitled. (The command in the next step assumes the drive is named Untitled.)

  3. Run command in terminal:

@leesmith
leesmith / command.txt
Created December 18, 2013 20:07
Disable "ApplePressAndHold" for applications in OSX
# You can disable this feature for just Sublime Text 3:
defaults write com.sublimetext.3 ApplePressAndHoldEnabled -bool false
# Alternately, if you want this feature disabled globally, you can enter this:
defaults write -g ApplePressAndHoldEnabled -bool false
@leesmith
leesmith / simple-git-workflow.md
Last active December 30, 2023 23:37
Simple Git Workflow For Continuous Delivery

Simple Git Workflow For Continuous Delivery

Workflow guidelines:

  • master branch is always production-ready, deployable, 100% green test suite
  • New development is done on feature branches, with frequent rebasing onto master
  • Clean commit history by preferring to rebase instead of merge (git pull is configured to automatically rebase)

rebase workflow

Workflow

Deploying a Rails 3 App with EC2 + S3 + Ubuntu + Capistrano + Passenger
=======================================================================
EC2 Setup
---------
1 Launch New ec2 instance - ami-1634de7f
2 Create elastic IP [ELASTIC_IP] and associate it with instance
3 go to domain registrar DNS settings, @ and www to ELASTIC_IP
4 set the `:host` in `config/deploy.rb` to ELASTIC_IP
@leesmith
leesmith / spec_helper.rb
Created February 6, 2014 21:37
Control garbage collection in rspec
RSpec.configure do |config|
# ...snip
config.before(:each) do
DatabaseCleaner.start
GC.disable
end
config.after(:each) do
DatabaseCleaner.clean
@leesmith
leesmith / single-session-development.md
Last active September 5, 2021 03:13
Single Session Development

Single Session Development

Posted March 06, 2013 02:31 By Veezus Kreist (http://blog.veez.us/)

I've always been a pretty austere guy. I'd rather have less things than more: every time I move I throw out half of what I have. I'm not big into customization, either; if there's a non-ridiculous default, that's what I'm using.

That ethos extends into my work. I use the default Terminal.app on my MacBook, with the built-in Pro theme. I use exactly 12 vim plugins, including my favorite color scheme. My dot files amount to only 300-some lines, including vim options, bash options, git options, and comments.

That's the background for this post on single-session development, the way I've been developing lately. When I say session, I mean shell session. I mean, log into one shell on my laptop, maximize it, and run everything in that one session: no tabs, no screen, and certainly no tmux. Bernerd Schaefer started me down this path in his Laptop-Driven Development; that post has been hanging out in the back of my