Skip to content

Instantly share code, notes, and snippets.

View doyle's full-sized avatar

Christian Doyle doyle

View GitHub Profile
@doyle
doyle / things.sql
Created February 17, 2014 23:11
How to query record's from Cultured Code's Thing's sqlite database
select ZTITLE, date(ZSTOPPEDDATE, 'unixepoch', '+31 years') as completed from zthing where completed is not null group by completed;
@doyle
doyle / DateConvert.m
Created February 18, 2014 02:05
Convert a NSAppleEventDescriptor to a NSDate
// Inspired by StefanK http://macscripter.net/profile.php?id=14351
- (NSDate *)dateFromEventDescriptor:(NSAppleEventDescriptor *)descriptor
{
NSDate *resultDate = nil;
OSStatus status;
CFAbsoluteTime absoluteTime;
LongDateTime longDateTime;
if ([descriptor descriptorType] == typeLongDateTime) {
[[descriptor data] getBytes:&longDateTime length:sizeof(longDateTime)];
status = UCConvertLongDateTimeToCFAbsoluteTime(longDateTime, &absoluteTime);

Twitter doesn't really provide me with the space to explain my issue so...

I have three apps all of which consume from a single service. I can easily think of 5 or so responsibilites of the service. In addition to this many endpoints are only used by one app. The code base is small (< 10k loc) and the responsibilites are well isolated. The team is also small and we only have a single ops.

My fear is that splitting the service into more granular services will create more work than its worth due to the ops overhead, need for client libraries, and other complexities that are introduced by using two completly isolated systems.

So what are some indicators that your service is too big and needs to be split up?

@doyle
doyle / git_archive.txt
Created April 28, 2015 14:47
Example usage of archiving a git repo to a tar file
git archive --format tar master | gzip -9 > foo.tar.gz
@doyle
doyle / Including resources on the iPhone and loading text files
Created June 21, 2009 02:59
Including files with your iPhone add + loading text files
//This sample loads a text file which is included with your iPhone application and sends the text to
// standard error
//
// This sample assumes you have added a file named "sometext.txt" to your "Resources" folder in your project.
-(NSString *)getFileLocation
{
NSBundle *bundle = [NSBundle mainBundle];
NSString *filePath = [bundle pathForResource:@"sometext" ofType:@"txt"];
// This sample creates a repeating timer and updates a label on the view each time the timer executes
@interface TimerTextViewController : UIViewController {
IBOutlet UILabel *label;
NSTimer *repeatingTimer;
NSUInteger timerCount;
}
// This gist demonstrates how to play a movie on the iPhone
// This code sample assumes you have a file called "Movie.m4v" in your Resources folder, and
// have /included the MediaPlayer Framework (/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/MediaPlayer.framework)
#import <MediaPlayer/MediaPlayer.h>
...
-(IBAction)playMovie:(id)sender{
@doyle
doyle / verbose
Created June 28, 2013 19:33
I'm tired of reading the terminal
#!/bin/sh
$@ > /tmp/verbose
say `cat /tmp/verbose`
@doyle
doyle / active_record_stdout.rb
Created October 2, 2013 19:26
Demonstrates how to log active record to stdout in a rails console.
ActiveRecord::Base.logger = Logger.new(STDOUT)
reload!
@doyle
doyle / integration_options_request.rb
Created November 20, 2013 19:38
Add this to your test_helper to enable options requests in rails integration tests
module ActionDispatch::Integration::RequestHelpers
def options(path, parameters = nil, headers_or_env = nil)
process :options, path, parameters, headers_or_env
end
end