Skip to content

Instantly share code, notes, and snippets.

@tomhoover
tomhoover / .bashrc
Created November 27, 2010 03:39 — forked from henrik/.bashrc
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server:

# bits from Simon's finance/accounting makefile
help: # describe make targets
@egrep '^[^ #A-Z]+:' Makefile
fixperms:
chmod -R go-rwx .
################################################################################
# personal finance
@tomhoover
tomhoover / README.md
Created January 14, 2012 21:05 — forked from rtlong/README.md
Template bash script, for when you need something over-engineered.

This template script was retrieved from BigSmoke's Blog on 18 February 2011. It was originally authored by [Wiebe Cazemier](mailto:Wiebe Cazemier ) and he deserves the credit. I am putting it on gist.github.com so I don't lose it, mostly, although I hope someone else is able to find it as useful as I do.

@tomhoover
tomhoover / photos_tag.rb
Created May 19, 2012 23:27 — forked from sukima/photos_tag.rb
Jekyll Plugin for easy FancyBox usage
# Title: Photos tag for Jekyll
# Authors: Devin Weaver
# Description: Allows photos tag to place photos as thumbnails and open in fancybox. Uses a CDN if needed.
#
# ** This only covers the markup. Not the integration of FancyBox **
#
# To see an unabridged explination on integrating this with [FancyBox][1]
# Please read my [blog post about it][2].
#
# [1]: http://fancyapps.com/fancybox/
#####
# Found on http://www.documentsnap.com/abbyy-finereader-and-snow-leopard-file-not-created-with-scansnap/
# and modified to work from command line and behave slightly differently. Creating an Automator script
# to trigger should be trivial, though. you'd want to add a "cd /path/to/incoming_scans" at the top.
#
# Works with ScanSnap on Snow Leopard with the latest Abby Fine Reader and ScanSnap drivers. Doesn't
# do the meta data munging though that should be trivial to add back in.
#
# Do you scanning all at once, then kick this script off when you leave your computer - this results in a
# great speed up in workflow
#!/bin/bash
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i64.2.dylib" \
"/usr/local/lib/libmacfuse_i64.2.dylib" \
"/usr/local/lib/libosxfuse_i32.la" \
"/usr/local/lib/libosxfuse_i64.la" \
"/usr/local/lib/pkgconfig/osxfuse.pc" )
#!/bin/bash
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i64.2.dylib" \
"/usr/local/lib/libmacfuse_i64.2.dylib" \
"/usr/local/lib/libosxfuse_i32.la" \
"/usr/local/lib/libosxfuse_i64.la" \
"/usr/local/lib/pkgconfig/osxfuse.pc" )

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

How to use Tim Pope's Pathogen.

I'll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/ with $HOME\vimfiles\ and forward slashes with backward slashes.

The idea.

Vim plugins are collections of specialized scripts that you are supposed to put in "standard" locations under your ~/.vim/ directory. Syntax scripts go into ~/.vim/syntax/, plugin scripts go into ~/.vim/plugin, documentation goes into ~/.vim/doc/ and so on. That design can lead to a messy config where it quickly becomes hard to manage your plugins.

This is not the place to explain the technicalities behind Pathogen but the basic concept is quite straightforward: each plugin lives in its own directory under ~/.vim/bundle/, where each directory simulates the standard structure of your ~/.vim/ directory.