Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<style>
input, textarea {
font-size: 80%;
margin: 1px;
padding: 3px 0 3px 3px;
background-color: #fff;
border-color: #666 #ccc #ccc;
border-style: solid;
let g:netrw_keepdir = 0
ActionController::Routing::Routes.routes.each do |r|
puts r
end
ActionController::Base.logger = Logger.new(STDOUT)
app.get '/athletes/browse'
AuthType Basic
AuthName "Password Required"
AuthUserFile /home/joe/public_html/kiwis/.htpasswd
AuthGroupFile /dev/null
Require user admin
socket: /var/mysql/mysql.sock
// 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);
// 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"];
<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>
@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