This file contains 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
require 'sinatra' | |
require 'dm-core' | |
require 'haml' | |
DataMapper.setup(:default, 'sqlite3::memory:') | |
class Message | |
include DataMapper::Resource | |
property :id, Serial |
This file contains 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
require 'rubygems' | |
require 'sinatra' | |
enable :sessions | |
get '/' do | |
session["value"] ||= "Hello world!" | |
"The cookie you've created contains the value: #{session["value"]}" | |
end |
This file contains 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
These are the things I did in order to have Gitosis installed and working on my Snow Leopard Server: | |
1. Install Git. | |
I use the installer for OS X provided by Google Code (http://git-osx-installer.googlecode.com/files/git-1.6.5.7-intel-leopard.dmg). | |
2. Install Gitosis | |
I got the Gitosis from the eagain.net server and I installed using Python bundled with Snow Leopard. | |
$ git clone git://eagain.net/gitosis.git | |
$ cd gitosis && python setup.py install |
This file contains 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
- (void)scan { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
ALAssetsGroupType sources = ALAssetsGroupLibrary | ALAssetsGroupSavedPhotos; | |
NSMutableArray *tags = [[NSMutableArray alloc] init]; | |
ALAssetsGroupEnumerationResultsBlock assetsEnumerator = ^(ALAsset *result, NSUInteger index, BOOL *stop){ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
if (result) { | |
if ([[result valueForProperty:ALAssetPropertyType] isEqual:ALAssetTypePhoto]) { |