Skip to content

Instantly share code, notes, and snippets.

View atnan's full-sized avatar

Nathan de Vries atnan

View GitHub Profile
<ul>
<% recent_posts.each do |post| %>
<li><%= link_tag h(post.title), post_url(post) %></li>
<% end %>
</ul>
ApiDocumentation.generate do
common_params :pagination do
param :page, 'The page to paginate to', :default => 1, :type => :integer
param :per_page, 'Total number of entries to include on each page', :default => 10, :type => :integer
end
category :sessions do
action('POST /signin.json') do
Accelerate.framework
AddressBook.framework
AddressBookUI.framework
ApplicationServices.framework
AudioToolbox.framework
AudioUnit.framework
CFNetwork.framework
CoreAudio.framework
CoreFoundation.framework
CoreGraphics.framework
id photoLibrary = [[PLPhotoLibrary alloc] initWithPath:@"/var/mobile/Media/Photos"];
photoList = [[NSMutableDictionary alloc] init];
int totalAlbums = [[photoLibrary albums] count];
int i, j;
for (i = 0; i < num; i++) {
album = [[photoLibrary albums] objectAtIndex:i];
id images = [album images];
for (j = 0; j < [images count]; j++) {
id imageID = [NSNumber numberWithInt: [[images objectAtIndex:j] imageID]];
United States 143441
Argentina 143505
Australia 143460
Belgium 143446
Brazil 143503
Canada 143455
Chile 143483
China 143465
Colombia 143501
Costa Rica 143495
@atnan
atnan / jsonp
Created January 16, 2009 05:38
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
begin
puts JSON::pretty_generate(JSON::parse(STDIN.read)).strip
rescue
STDERR.write('Failed to parse JSON')
exit 1
sips -s format png /Developer/Applications/Xcode.app/Contents/Resources/appicon.icns --out /tmp/xcode.png
convert -resize 128x128 /tmp/xcode.png /tmp/xcode_small.png
composite -gravity SouthEast /tmp/xcode_small.png /tmp/xcode.png /tmp/xcode_composite.png
This file has been truncated, but you can view the full file.
Index: lex.c.src
===================================================================
--- lex.c.src (.../v1_9_0_5) (revision 21934)
+++ lex.c.src (.../v1_9_1_rc2) (revision 21934)
@@ -1,51 +0,0 @@
-%{
-struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
-const struct kwtable *rb_reserved_word(const char *, unsigned int);
-#ifndef RIPPER
-%}
#import "CommonCrypto/CommonDigest.h"
@interface NSString (NSStringAdditions)
- (id) stringByPerformingMD5Checksum;
- (id) stringByEncodingIllegalURLCharacters
- (id) stringByDecodingIllegalURLCharacters
@end
sudo gem list --local | grep "^merb-" | cut -d " " -f1 | while read gem; do
sudo gem uninstall -a $gem
done