Skip to content

Instantly share code, notes, and snippets.

View nclark's full-sized avatar
💭
wu tang is for the children

Neal Clark nclark

💭
wu tang is for the children
View GitHub Profile
do you ever try to edit some shit, like /etc/hosts or some apache
config, and forget to sudo? and then you have to f-ing exit vim and
re-run the command with sudo out in front of it? i hate that shit.
so here's a way to deal with that.
1. install the sudo.vim plugin
mkdir -p ~/.vim/plugin && cd ~/.vim/plugin \
&& curl -o sudo.vim \
'http://www.vim.org/scripts/download_script.php?src_id=3477'
env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5
@nclark
nclark / README.markdown
Created December 16, 2009 21:49
ls --color

how to get more readable directories with ls --color

the problem

by default, gls/ls --color prints the directory name using a rather dark blue foreground. i
use a black terminal...i think most people do too. i find this to be quite unreadable.

Image of problem

@nclark
nclark / gitconfig
Created January 18, 2010 23:10 — forked from Lytol/gist:280458
.gitconfig
[user]
email = <your-email>
name = <your-name>
[color]
diff = auto
status = auto
branch = auto
[alias]
st = status
co = checkout
@nclark
nclark / git-fuckit
Created February 26, 2010 05:04
git fuckit --hard
#!/bin/bash
if [ "$1" == "--hard" ]; then
git add .
git reset --hard
else
git add .
git commit -a -m 'FUCK' > /dev/null
git reset HEAD^
*.pbxproj -crlf -diff -merge

stole this off a blog post somewhere, i forget. makes your rake spec output like 900 times more PIMP.

script/runner 'require("db/migrate/###_yo_migration.rb").first.constantize.up'
@nclark
nclark / create_ctags_with_bundler.rb
Created February 12, 2011 03:32
create ctags for all your gems using Gemfile.lock
#!/usr/bin/ruby
require 'bundler'
lockfile_contents = Bundler.read_file('Gemfile.lock')
lockfile = Bundler::LockfileParser.new(lockfile_contents)
paths = lockfile.specs.collect do |spec|
spec.__materialize__
spec.full_gem_path
end