Skip to content

Instantly share code, notes, and snippets.

@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,
@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 / 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 / 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: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: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];
}