Skip to content

Instantly share code, notes, and snippets.

View mikekavouras's full-sized avatar

Mike Kavouras mikekavouras

View GitHub Profile
NSArray *bkLat = @[
@(40.720852),
@(40.721852),
@(40.722852),
@(40.723852),
@(40.724852),
@(40.725852),
@(40.726852),
@(40.727852),
@(40.728852),
NSArray *mLats = @[
@(40.73308),
@(40.73408),
@(40.73508),
@(40.73608),
@(40.73708),
@(40.73808),
@(40.73908),
@(40.74008),
@(40.74108),
var onHeadingUpdateListener: ((heading: CLHeading) -> Void)?
onHeadingUpdateListener = { (heading: CLHeading) -> Void in
print(heading)
}
#!/bin/bash
if [ ! $2 ]; then
echo "$ ./github.sh *repository_name* ./username.txt"
exit 0
fi
rootpath=~/Desktop/repos/$1;
if [ ! -d ${rootpath} ]
then
- (void)viewDidLoad {
[super viewDidLoad];
_peripheralManager = [[CBPeripheralManager alloc] initWithDelegate:self queue:nil];
[_peripheralManager startAdvertising:@{ CBAdvertisementDataServiceUUIDsKey : @[[CBUUID UUIDWithString:TRANSFER_SERVICE_UUID]] }];
}
func doTheThing(num: Int) -> Int {
guard num != 1 else {return 1}
let diff = [0, -1, 1][num % 3]
print("\(num), \(diff)")
return doTheThing((num + diff) / 3)
}
//
// ViewController.swift
// FacebookTest
//
// Created by Michael Kavouras on 10/31/15.
// Copyright © 2015 Michael Kavouras. All rights reserved.
//
import UIKit
import ParseFacebookUtilsV4
//
// AppDelegate.swift
// FacebookTest
//
// Created by Michael Kavouras on 10/31/15.
// Copyright © 2015 Michael Kavouras. All rights reserved.
//
import UIKit
import CoreData
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
[manager GET:@"http://example.com/resources.json" parameters:nil success:^(NSURLSessionTask *task, id responseObject) {
NSLog(@"JSON: %@", responseObject);
} failure:^(NSURLSessionTask *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
NSDate *date = [NSDate dateWithTimeIntervalSinceReferenceDate:time];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"EEEE"];
NSString *dateName = [dateFormatter stringFromDate:date];