Skip to content

Instantly share code, notes, and snippets.

@joepestro
joepestro / gist:1022126
Created June 12, 2011 23:29
Playing around with a minimap toggle for vim. When activated, gives an overview of the current window and highlights the text that was in the visible area. Still needs some tweaking.
function! ToggleMinimap()
if exists("s:isMini") && s:isMini == 0
let s:isMini = 1
else
let s:isMini = 0
end
if (s:isMini == 0)
" save current visible lines
let s:firstLine = line("w0")
@joepestro
joepestro / gist:1015827
Created June 9, 2011 01:22
Adds :NERDTreeFindHighlight command to act like TextMate's Reveal in Project
" find, then highlight file
function! NERDTreeFindHighlight()
let s:filename = expand("%:t")
NERDTreeFind
silent! exe "normal /" . s:filename . "/\<CR>"
endfunction
command! NERDTreeFindHighlight call NERDTreeFindHighlight()
@joepestro
joepestro / gist:1013011
Created June 7, 2011 19:56
Function for .vimrc to automatically cd to the root of current tab's NERDTree
function! ChangeDirectoryToNERDTreeDir()
" fallback to parent directory
let s:path = expand("%:p:h")
" if NERDTree is present in this tab, cd to it:
if exists("g:NERDTreeDirNode.GetRootForTab().path._strForCd()")
let s:path = g:NERDTreeDirNode.GetRootForTab().path._strForCd()
endif
" don't do anything if we're restoring a session
<div id="fanvibe-widget">
<a href="http://fanvibe.com" id="fanvibe-link">See more on Fanvibe.com</a>
</div>
<script type="text/javascript">
var fanvibeUID = 2;
(function() { var s, s1; s = document.createElement('SCRIPT'); s.type = 'text/javascript'; s.async = true; s.src = 'http://fanvibe.com/widgets.js?uid=' + fanvibeUID; s1 = document.getElementsByTagName('SCRIPT')[0]; s1.parentNode.insertBefore(s, s1); document.getElementById("fanvibe-link").style.visibility = 'hidden'; })();
</script>
// Example using the ASIHTTPRequest library
// http://allseeing-i.com/ASIHTTPRequest/
- (IBAction)checkIn:(id)sender {
NSURL* url = [NSURL URLWithString:@"https://api.fanvibe.com/v1/checkin"];
ASIFormDataRequest* request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease];
[request setDelegate:self];
[request setRequestMethod:@"POST"];
[request setPostValue:@"107763" forKey:@"game_id"];
// Create address book reference
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFIndex nPeople = ABAddressBookGetPersonCount(addressBook);
// Pull all records out of address book
NSMutableArray* users = [[NSMutableArray alloc] init];
for (int i = 0; i < nPeople; i++) {
ABRecordRef ref = CFArrayGetValueAtIndex(allPeople, i);
CFStringRef firstName = ABRecordCopyValue(ref, kABPersonFirstNameProperty);
socket: /var/mysql/mysql.sock
AuthType Basic
AuthName "Password Required"
AuthUserFile /home/joe/public_html/kiwis/.htpasswd
AuthGroupFile /dev/null
Require user admin
ActionController::Base.logger = Logger.new(STDOUT)
app.get '/athletes/browse'
ActionController::Routing::Routes.routes.each do |r|
puts r
end