Skip to content

Instantly share code, notes, and snippets.

View kevinjstewart's full-sized avatar
🥑
Avocado

Kevin Stewart kevinjstewart

🥑
Avocado
View GitHub Profile
@tonyalbor
tonyalbor / github xcode project
Created April 6, 2014 02:13
uploading an xcode project to github
// adding xcode project to github
// create git repo on github
// go to directory with .xcodeproj file
git init
git add .
git commit -m 'initial commit'
git remote add origin git@github.com:tonyalbor/REPOSITORY.git
git pull origin master
git push origin master
@ariok
ariok / [CoreData]EntriesBetweenDates.m
Created November 29, 2013 17:01
Get Core Data entries between a date range
+ (NSArray*)allEntriesInContext:(NSManagedObjectContext*)context fromDate:(NSDate*)fromDate toDate:(NSDate*)toDate{
// Create the request
NSFetchRequest *request = [[NSFetchRequest alloc]initWithEntityName:@"Entry"];
// Build the predicate
NSPredicate *predicate = [NSPredicate predicateWithFormat: @"date >= %@ && date <= %@ ", fromDate, toDate];
request.predicate = predicate;
// Define sorting
NSSortDescriptor *sortDesc = [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES];
request.sortDescriptors = @[sortDesc];
@Voles
Voles / datefilter.js
Created April 25, 2013 12:41
AngularJS daterange filter
RB.filter('daterange', function ()
{
return function(conversations, start_date, end_date)
{
var result = [];
// date filters
var start_date = (start_date && !isNaN(Date.parse(start_date))) ? Date.parse(start_date) : 0;
var end_date = (end_date && !isNaN(Date.parse(end_date))) ? Date.parse(end_date) : new Date().getTime();