Skip to content

Instantly share code, notes, and snippets.

# coding: utf-8
# In[1]:
# In[7]:
import struct
import numpy as np
from scipy.misc.pilutil import toimage
from PIL import Image
@laanlabs
laanlabs / gist:1282937
Created October 12, 2011 23:22
ios 5 update
the problem with the error message <your device> could not be restored is basically the verification server at apple is overwhelmed (gs.apple.com) -- you can eventually get it to restore -- you just need to keep trying manually if you cant wait -- to do so
this only works if you got the restore file already - iPhone3,1_5.0_9A334_Restore.ipsw if you dont have -- its going to take like 10hrs to download - if you do have it
1. get your restore file and put it on desktop so itunes can easily get it - its in <user>/Library/iTunes/iPhone Software Updates
2. in itunes - option restore and pick file "iPhone3,1_5.0_9A334_Restore.ipsw" - again make sure you have backup first
again you may have to try this like 20+ times -- its just getting itunes to connect to apple servers during a lull
@laanlabs
laanlabs / seeking_engineers.rst
Created June 24, 2011 17:11 — forked from lumberlabs/seeking_engineers.rst
Mini job req for Lumber Labs engineering positions

Wanted: Talented engineering colleagues

Lumber Labs is an early stage, well-funded mobile payments start-up located in San Francisco. Company founders were early employees at AdMob, and are now building software to enable simple, low-friction transactions on a mobile device.

Why you might want to work with us:
  • Tackle interesting, hard technical problems with immediate real world application.
  • Maintain a work-life balance and have fun.
  • Generous comp, benefits, and vacation.
unsigned char result[CC_SHA256_DIGEST_LENGTH];
CC_SHA256([input bytes], [input length], result);
NSMutableString *output = [NSMutableString stringWithCapacity:CC_SHA256_DIGEST_LENGTH * 2];
for(int i = 0; i < CC_SHA256_DIGEST_LENGTH; i++)
[output appendFormat:@"%02x",result[i]];
@laanlabs
laanlabs / gist:938689
Created April 23, 2011 15:10
TapShare example
NSString * messyIp = @"http://192.168.1.113:45543";
NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@"http://wifitransfer.appspot.com/api/v1/get_code?long_url=%@",messyIp]];
NSString * responseStr = [NSString stringWithContentsOfURL:url];
id obj = [responseStr JSONValue];
NSString * link = nil;
NSString * hash = nil;
id status = [obj objectForKey:@"status_code"];
if ( [status intValue] == 200 ) {
@laanlabs
laanlabs / tapshare.m
Created April 23, 2011 15:05
TapShare Example
NSString * messyIp = @"http://192.168.1.113:45543";
NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@"http://wifitransfer.appspot.com/api/v1/get_code?long_url=%@",messyIp]];
NSString * responseStr = [NSString stringWithContentsOfURL:url];
id obj = [responseStr JSONValue];
NSString * link = nil;
NSString * hash = nil;
id status = [obj objectForKey:@"status_code"];
if ( [status intValue] == 200 ) {