Skip to content

Instantly share code, notes, and snippets.

View jonnolen's full-sized avatar

Jon Nolen jonnolen

  • Indianapolis, IN
View GitHub Profile
require 'rubygems'
require 'data_mapper'
require 'dm-timestamps'
require 'active_support/core_ext'
DataMapper::Model.raise_on_save_failure = true
class User
include DataMapper::Resource
property :id, String, :default => lambda {|r,p| SecureRandom.uuid}, :key=>true
property :givenName, String, :length => 255, :default => ""
property :surname, String, :length => 255, :default => ""
@jonnolen
jonnolen / GenerateUUID.py
Last active December 14, 2015 04:39
sublime text plugin to generate a uuid
# Sublime Text 2 Plugin to generate a UUID in place.
# I used this to build out a sample data file with dependable UUID's for testing purposes.
import sublime, sublime_plugin, uuid
class GenerateUuidCommand(sublime_plugin.TextCommand):
def run(self, edit):
for s in self.view.sel():
if s.empty():
self.view.insert(edit, s.b, str(uuid.uuid4())
import sublime, sublime_plugin, uuid
class GenerateUuidCommand(sublime_plugin.TextCommand)
def run(self, edit):
for s in self.view.sel():
if (s.empty())
self.view.insert(edit, s.b, str(uuid.uuid4()))
@jonnolen
jonnolen / PWPDFToolbar.m
Last active December 14, 2015 12:18
custom pspdfkit annotation demonstrating 2.8.7 hud view issue
//
// PWPDFToolbar.m
// passageways
//
// Created by Jonathan Nolen on 1/23/13.
// Copyright (c) 2013 Developertown. All rights reserved.
//
#import "PWPDFToolbar.h"
#import <PSPDFKit/PSPDFKit.h>
@jonnolen
jonnolen / UserCoreDataAnnotationProvider.m
Created March 5, 2013 20:42
PSPDFAnnotationProvider implementation backed by core data
//
// UserCoreDataAnnotationProvider.m
// BoardRoom
//
// Created by Jonathan Nolen on 3/2/13.
//
//
#import "UserCoreDataAnnotationProvider.h"
#import "Annotation.h"
@interface CachedAnnotation : NSObject
@property (nonatomic, strong) NSManagedObjectID *objectId;
@property (nonatomic, strong) PSPDFAnnotation *annotation;
+(CachedAnnotation *)cachedAnnotationWithCoreDataAnnotation:(Annotation *)annotation;
+(CachedAnnotation *)cachedAnnotationWithObjectId:(NSManagedObjectID *)objectId nativeAnnotation:(PSPDFAnnotation *)annotation;
@end

Call For Volunteers

Girls, Inc Summer Camp and Coder Dojo Indy

Game Building Workshop, Ages 9-11

Dates

  • June 23rd 1pm - 6pm
  • June 24 - 28th, 11am - 12pm
@jonnolen
jonnolen / rac_signal_testTests.m
Last active December 20, 2015 11:49
Test cases to show issue with sendComplete for subjects on gcd queue.
#import <ReactiveCocoa/ReactiveCocoa.h>
@interface rac_signal_testTests: SenTestCase
@end
@implementation rac_signal_testTests
- (void)setUp
{
[super setUp];
@jonnolen
jonnolen / rac_willDeallocSingal_learning_teest.m
Created August 5, 2013 13:40
Issue with weak property not getting set to nil when rac_willDeallocSignal is attached.
#import <ReactiveCocoa/ReactiveCocoa.h>
#import <SenTestingKit/SenTestingKit.h>
@interface rac_signal_testTests : SenTestCase
@end
@implementation rac_signal_testTests
-(void)test_willDeallocSignal_applied_to_strong_reference_works_as_expected_with_local_weak_reference{
id val = [@{} mutableCopy];
// An object that will run a piece of code every <<interval>> seconds while the application has connectivity to the network,
// automatically pauses the loop when isNetworkReachable is false.
#import <ReactiveCocoa/ReactiveCocoa.h>
#import <ReactiveCocoa/NSNotificationCenter+RACSupport.h>
@interface PWOfflineUpdater : NSObject
-(id)initWithUpdateInterval:(NSTimeInterval)interval targetOperationQueue:(NSOperationQueue *)queue;