Skip to content

Instantly share code, notes, and snippets.

@leesmith
leesmith / non-ascii.txt
Created September 29, 2015 16:47
Highlight non-ASCII characters in VIM
/[^\x00-\x7F]
@leesmith
leesmith / mysql-csv-dump.sql
Created August 13, 2015 13:28
Dump mysql to CSV
select * from users into outfile 'users.csv' fields terminated by ',' optionally enclosed by '"' lines terminated by '\n';
@leesmith
leesmith / keyboards.txt
Last active February 3, 2017 14:59
Keyboards
https://www.reddit.com/r/MechanicalKeyboards/wiki/buying_guide
WASD CODE 87-Key Mechanical Keyboard - Cherry MX Clear
http://www.wasdkeyboards.com/index.php/products/code-keyboard/code-87-key-mechanical-keyboard.html
KUL ES-87 Tenkeyless Keyboard (Cherry MX Clear)
http://www.elitekeyboards.com/products.php?sub=keyed_up_labs,tenkeyless&pid=es87u_cc_bbb_al
@leesmith
leesmith / event.js.coffee
Last active August 29, 2015 14:04
jQuery event delegation
$(document).ready ->
$(document)
.on('ajax:before', ".single-line-qualification", (e) ->
debugger
# do validation and return false to cancel ajax
if e.target[1].value.trim() == ''
e.target[1].value = ''
alert 'You must enter a name!'
return false
)
@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

@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
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 / 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

@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 / 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: