Skip to content

Instantly share code, notes, and snippets.

View grantland's full-sized avatar

Grantland Chew grantland

View GitHub Profile
@grantland
grantland / README.md
Created October 8, 2012 21:42
iOS NSURLCache bug

NSURLCache uses more than just the HTTP method and URL properties of NSURLRequest as the key for its cache. Therefore, it is possible for a request with method=GET and URL=X to return a miss with NSURLCache even though a NSCachedURLResponse was stored with method=GET and URL=X. These misses can be caused by non-http properties of NSURLRequest being different than the NSURLRequest used to store the NSCachedURLResponse.

We've seen the following show up as a miss:

NSURLCache * cache = //...    
NSURL *url = [NSURL URLWithString:@"http://example.com"];
NSURLRequestCachePolicy cachePolicy = NSURLRequestReturnCacheDataElseLoad;
NSURLRequest r1 = [NSURLRequest requestWithURL:url cachePolicy:cachePolicy timeoutInterval:30];
NSURLRequest r2 = [NSURLRequest requestWithURL:url cachePolicy:cachePolicy timeoutInterval:60];
@grantland
grantland / hexalter.cpp
Created October 2, 2015 07:07 — forked from Jakz/hexalter.cpp
Simple cmmand line byte modifier that replaces raw bytes inside a given file
#include <stdint.h>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
using namespace std;
struct Patch
{
@grantland
grantland / gist:1255027
Created September 30, 2011 21:33
ANDROID_ID
/data/data/com.android.providers.settings/databases/settings.db
select * from secure where name='android_id'
@grantland
grantland / gist:1201813
Created September 7, 2011 21:32
Android SharedPreferences
SharedPreferences information in a xml file in plain text
to find it:
/data/data/<package>/shared_prefs/
generally default.xml but may be another file
@grantland
grantland / gist:1201810
Created September 7, 2011 21:31
iOS Keychain
standardUserDefaults stores information in a plist file in plain text
To find it:
cd /User/Applications/
grep <app name> *
/User/Applications/<random string>/Library/Preferences/<bundle id>.plist
@grantland
grantland / gist:1068362
Created July 6, 2011 21:25 — forked from jamiebriant/gist:452213
Fix for categories in static libraries requiring -all_load/-force_load
diff --git a/Build/Products/three20/Three20/.fix b/Build/Products/three20/Three20/.fix
new file mode 100644
index 0000000..e69de29
diff --git a/Build/Products/three20/Three20Core/.fix b/Build/Products/three20/Three20Core/.fix
new file mode 100644
index 0000000..e69de29
diff --git a/Build/Products/three20/Three20Network/.fix b/Build/Products/three20/Three20Network/.fix
new file mode 100644
index 0000000..e69de29
diff --git a/Build/Products/three20/Three20Style/.fix b/Build/Products/three20/Three20Style/.fix
----- pid 1297 at 2015-03-11 19:47:34 -----
Cmd line: system_server
ABI: x86_64
Build type: optimized
Zygote loaded classes=3593 post zygote classes=2212
Intern table: 38395 strong; 1947 weak
JNI: CheckJNI is on; globals=826 (plus 15 weak)
Libraries: /system/lib64/libandroid.so /system/lib64/libandroid_servers.so /system/lib64/libaudioeffect_jni.so /system/lib64/libcompiler_rt.so /system/lib64/libjavacrypto.so /system/lib64/libjnigraphics.so /system/lib64/libmedia_jni.so /system/lib64/librs_jni.so /system/lib64/libsoundpool.so /system/lib64/libwebviewchromium_loader.so /system/lib64/libwifi-service.so libjavacore.so (12)
Heap: 1% free, 10MB/10MB; 148650 objects