Skip to content

Instantly share code, notes, and snippets.

View dob's full-sized avatar

Doug Petkanics dob

View GitHub Profile
@dob
dob / gist:995510
Created May 27, 2011 15:41
Meetup RSVP Stream
{
"_id" : ObjectId("4d91585fe31f0d3ae1002876"),
"group" : {
"group_country" : "us",
"group_lat" : 39.78,
"group_city" : "Denver",
"group_name" : "Business Mommies",
"group_lon" : -104.76,
"group_topics" : [
{
# If you post to a Ruby on Rails REST API endpoint, then you'll get an
# InvalidAuthenticityToken exception unless you set a different
# content type in the request headers, since any post from a form must
# contain an authenticity token.
#
# This example shows you how to post to a rails endpoint.
require 'json'
# mongo_template.rb
# fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842)
#
# To use:
# rails project_name -m http://gist.github.com/gists/219223.txt
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
This is a multi-part message in MIME format...
------------=_1261499068-19033-0
Content-Type: text/plain; charset=utf-8
We have received an inquiry about Snapm.
From: petkanics@gmail.com
At: 2009-12-22 11:24:27 -0500
Message: I'm hoping that turning off the subscription management doesn't mess up the newlines.
case NSFetchedResultsChangeMove:
// Move the row
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
[tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade];
// Delete the section if it's now empty
if ([[controller sections] count] == 1){
[self.tableView deleteSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationFade];
}
break;
- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath {
UITableView *tableView = self.tableView;
switch (type) {
case NSFetchedResultsChangeInsert:
[tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade];
break;
case NSFetchedResultsChangeDelete:
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
break;
def test():
print 'this is a test gist'