Foo bar
biz bazz!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import yaml | |
import json | |
# Assumed we want to use stdin and stdout | |
print json.dumps(yaml.load(sys.stdin.read()), indent=4) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless Rails.env.production? | |
module ActiveModel | |
class IllegalMassAssignment < StandardError | |
end | |
module MassAssignmentSecurity | |
module Sanitizer | |
def warn!(invalid_keys) | |
raise ActiveModel::IllegalMassAssignment, "You attempted to mass-assign: #{invalid_keys.join(', ')}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* call processNextArchiveEntry in some kind of loop! */ | |
- (int)processNextArchiveEntry:(struct archive *)archive | |
{ | |
struct archive_entry *entry = NULL; | |
int result = ARCHIVE_OK; | |
result = archive_read_next_header(archive, &entry); | |
if (result == ARCHIVE_OK) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from scrapy.link import Link | |
from urlparse import urljoin | |
from BeautifulSoup import BeautifulSoup | |
class SoupLinkExtractor(object): | |
def __init__(self, *args, **kwargs): | |
super(SoupLinkExtractor, self).__init__() | |
allow_re = kwargs.get('allow', None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## script POMODORO for OSX! ## | |
# # | |
# requires the GNU gdate command to format dates # | |
# it's available through macports, in the coreutils package # | |
# this script also requires Growl to display notifications # | |
# # | |
# Times are coded as follows: # | |
# @ long break : 30 minutes # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
open "http://www.yubnub.org/parser/parse?command=$(echo -n "$*")" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BinaryDataScanner.m | |
// | |
// Copyright 2009 Dave Peck <davepeck [at] davepeck [dot] org>. All rights reserved. | |
// http://davepeck.org/ | |
// | |
// This class makes it quite a bit easier to read sequential binary files in Objective-C. | |
// | |
// This code is released under the BSD license. If you use it in your product, please | |
// let me know and, if possible, please put me in your credits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// FlickDynamics.h | |
// (c) 2009 Dave Peck <davepeck [at] davepeck [dot] org> | |
// http://davepeck.org/ | |
// | |
// This code is released under the BSD license. If you use my code in your product, | |
// please put my name somewhere in the credits and let me know about it! | |
// | |
// This code mimics the scroll/flick dynamics of the iPhone UIScrollView. | |
// What's cool about this code is that it is entirely independent of any iPhone |
NewerOlder