Skip to content

Instantly share code, notes, and snippets.

function! MyFoldText() " {{{
let line = getline(v:foldstart)
" so that it works when relativenumber has been set
if (&relativenumber)
let nucolwidth = &fdc + &relativenumber * &numberwidth
else
let nucolwidth = &fdc + &number * &numberwidth
endif

This is a tutorial for beginning users of the macintosh terminal. Please feel free to fork this and edit/augment it. Good changes will get merged in.

<script type="text/javascript">
var appVer = navigator.appVersion;
var searchVersion = /\s(\d)_\d/;
var searchDevice = /\s[(](\w+\s?\w*)[;]\s/;
var isIPhone = false;
var isIPad = false;
if (searchVersion.exec(appVer) && searchDevice.exec(appVer)){
var deviceVersion = searchVersion.exec(appVer)[1];
if ("iPhone" == searchDevice.exec(appVer)[1]){ isIPhone = deviceVersion; }
if ("iPhone Simulator" == searchDevice.exec(appVer)[1]){ isIPhone = deviceVersion; }
alias reload='. ~/.bashrc'
alias ea="$EDITOR ~/bin/dotfiles/bash/aliases && reload"
alias ee="$EDITOR ~/bin/dotfiles/bash/env && reload"
alias eh="$EDITOR ~/bin/dotfiles/bash/heroku && reload"
# Processes
alias tu='top -o cpu'
alias tm='top -o vsize'
# Projects
/*
Jquery and Rails powered default application.js
Easy Ajax replacement for remote_functions and ajax_form based on class name
All actions will reply to the .js format
Unostrusive, will only works if Javascript enabled, if not, respond to an HTML as a normal link
respond_to do |format|
format.html
format.js {render :layout => false}
end
*/
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
/* `HTML5 Reset
----------------------------------------------------------------------------------------------------*/
a,
abbr,
address,
article,
aside,
audio,
b,
// Run via OS X Terminal.app to block junk tweets in Tweetie.
// Info: http://atebits.posterous.com/test-filtering-in-tweetie-for-mac
defaults write com.atebits.tweetie-mac filterTerms -array "@gowalla" "http://gowal.la" "@foursquare" "http://4sq.com"
[alias]
up = !sh -c 'git pull && git log --pretty=format:\"%Cred%ae %Creset- %C(yellow)%s %Creset(%ar)\" HEAD@{1}..'
(?xi)
\b
( # Capture 1: entire matched URL
(?:
[a-z][\w-]+: # URL protocol and colon
(?:
/{1,3} # 1-3 slashes
| # or
[a-z0-9%] # Single letter or digit or '%'
# (Trying not to match e.g. "URI::Escape")