Skip to content

Instantly share code, notes, and snippets.

# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
@dchest
dchest / log2icalendar.rb
Created April 14, 2009 02:24
Outputs git log in iCalendar (.ics) format
#!/usr/bin/env ruby
#
# Git log to iCalendar
#
# Written by Dmitry Chestnykh, 5 Aug 2008
# Public domain
#
# Usage:
#
# cd git-repo
@zaphar
zaphar / date_util.erl
Created May 1, 2009 06:07
set of utility functions that wrap the calendar module and erlangs now() date() and time() functions
-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.
-- save as "Add Pinboard Bookmark.scpt" in ~/Library/Scripts/Applications/Safari
-- assign it ⌘D in FastScripts to use instead of Safari's bookmarks
tell application "Safari"
set pinboardBookmarklet to "
document.location = 'http://pinboard.in/add?next=same' +
'&url=' + encodeURIComponent(location.href) +
'&title=' + encodeURIComponent(document.title);
"
do JavaScript pinboardBookmarklet in document 1
@jeetsukumaran
jeetsukumaran / custom_iterator.cpp
Created February 18, 2010 02:33
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@frasten
frasten / keylogger.c
Created June 12, 2010 15:00
Linux keylogger
/* Compilare con:
* gcc keys.c -lX11 -o keylogger
*/
#include <X11/Xlib.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <X11/keysym.h>

Objective-C Coding Convention and Best Practices

Most of these guidelines are to match Apple's documentation and community-accepted best practices. Some are derived some personal preference. This document aims to set a standard way of doing things so everyone can do things the same way. If there is something you are not particularly fond of, it is encouraged to do it anyway to be consistent with everyone else.

This document is mainly targeted toward iOS development, but definitely applies to Mac as well.

Operators

NSString *foo = @"bar";
@vmg
vmg / gist:959251
Created May 6, 2011 16:07
2000 curated "that's what she said" jokes to train a Bayesian classifier
Wow! It's so much better when you do it faster!
Take it out and start working on it.
I wish you would finish already.
This thing is huge. I can hardly put my hand around it and it wont fit in my mouth.
When you push it down, it's supposed to rise back up.
I hate it when balls come near me.
Alright Justin, what am I doing wrong here, help me out cause it shouldn't take this long.
Wow, why do you only have one hand on there? Is it not big enough for both of them?
I think I cant swallow it anymore.
I like the long thick black ones.
@140bytes
140bytes / LICENSE.txt
Created May 9, 2011 16:13
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE