Skip to content

Instantly share code, notes, and snippets.


Dino Budimilić budidino

View GitHub Profile
budidino / isVenueOpenWithFoursquareHours
Last active Apr 28, 2017
handle foursquare hours API - return if venue is open, if it's going to be open or when it closed
View isVenueOpenWithFoursquareHours
// defaults and inits
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDictionary *lastSegmentYesterday = [[NSDictionary alloc] init];
NSDate *dateNow = [NSDate date];
NSString *venueOpenText = [[NSString alloc] init];
NSString *venueOpen = @"no";
// get components for today
NSDateComponents *compsNow = [gregorian components:NSWeekdayCalendarUnit|NSHourCalendarUnit|NSMinuteCalendarUnit|NSDayCalendarUnit|NSMonthCalendarUnit|NSYearCalendarUnit fromDate:dateNow];
View stackoverflow - returnTweet()
// example to help out someone on stackoverflow
// get the array of tweets
$tweets = returnTweet();
// loop all the tweets and display each of them
foreach($tweets as $tweet){
echo "Tweet: " . $tweet["text"] . "<br>";