Skip to content

Instantly share code, notes, and snippets.

@eito
eito / gist:7175555
Created October 26, 2013 22:55
deferred updates
-(void)locationManager:(CLLocationManager *)manager didFinishDeferredUpdatesWithError:(NSError *)error {
NSLog(@"%s -- error: %@", __PRETTY_FUNCTION__, error);
_deferring = NO;
}
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {
NSLog(@"%s -- %d locations", __PRETTY_FUNCTION__, locations.count);
[self.locationUpdates addObject:locations];
[self.tableView reloadData];
}
@eito
eito / gist:7275281
Created November 2, 2013 03:46
deferred location
//
// ViewController.m
// DeferredLocationTest
//
// Created by Eric Ito on 10/26/13.
// Copyright (c) 2013 Eric Ito. All rights reserved.
//
#import "ViewController.h"
@eito
eito / gist:7952128
Last active December 31, 2015 07:09
NSURLSession category bug
#import <Foundation/Foundation.h>
@interface NSURLSession (Stuff)
-(void)doStuff;
@end
@implementation NSURLSession (Stuff)
-(void)doStuff {
NSLog(@"stuff");
}
@eito
eito / gist:8108401
Created December 24, 2013 03:26
git rewrite committer/author in history
git filter-branch --commit-filter '
if [ "$GIT_COMMITTER_NAME" = "<Old Name>" ];
then
GIT_COMMITTER_NAME="<New Name>";
GIT_AUTHOR_NAME="<New Name>";
GIT_COMMITTER_EMAIL="<New Email>";
GIT_AUTHOR_EMAIL="<New Email>";
git commit-tree "$@";
else
git commit-tree "$@";
@eito
eito / ssd.py
Last active January 3, 2016 10:49
d=''.join(map("{0:07b}".format,[126,48,109,121,51,91,95,112,127,123]))
a=raw_input()
l=" ### "
x=" "
p="#"
q=" #"
i=int
for r in range(9):
for n in a:
v=map(i,d[i(n)*7:7*i(n)+7]);t=x*5
@eito
eito / main.py
Created January 18, 2014 19:34
154!
l=raw_input()
for s in[0,1,3,4,6]:a=3**(s%3);print(' '.join([' ## # # # # #'[((ord('A$]m(kK%Ii'[int(x)])>>s&a)+a-1)::5]for x in l])+'\n')*a,
l=raw_input()
for s in[0,1,3,4,6]:a=3**(s%3);exec"print' '.join([' ## # # # # #'[(ord('A$]m(kK%Ii'[int(x)])>>s&a)+a::5]for x in l]);"*a
@eito
eito / main.m
Created May 28, 2014 18:26
Test Custom Callout
@interface CalloutTest ()<AGSMapViewTouchDelegate>
@property (nonatomic, strong) AGSMapView *mapView;
@property (nonatomic, strong) UIView *customCalloutView;
@end
@implementation CalloutTest
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
<html>
<head>
<title>BIG-IP logout page</title>
<link rel="stylesheet" type="text/css" HREF="/public/include/css/apm.css">
<script src="/public/include/js/common.js" language="javascript"></script>
<script src="/public/include/js/u_plugin.js" language="javascript"></script>
<script language="javascript">
function InsertActivexControl(clsid, params)
{
@eito
eito / gist:26499579293bcd22a61d
Created June 3, 2014 19:43
first swift ArcGIS mapping app... boom!
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let map = AGSMapView(frame:self.view.bounds)
let osm = AGSOpenStreetMapLayer()
map.addMapLayer(osm)
self.view.addSubview(map);