I hereby claim:
- I am bogardon on github.
- I am bogardon (https://keybase.io/bogardon) on keybase.
- I have a public key ASBStiOygv-K63_17Fcl7nDccUXVcmcZH9JR7LOt6hArjQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| # -*- coding: utf-8 -*- | |
| $:.unshift(ENV["RUBYMOTION_LIB"] || "/Library/RubyMotion/lib") | |
| require 'motion/project/template/ios' | |
| require 'bundler' | |
| require 'sugarcube-attributedstring' | |
| Bundler.require | |
| Motion::Project::App.setup do |app| | |
| app.xcode_dir = "/Applications/Xcode.app/Contents/Developer" |
| class User < Model | |
| set_attributes :username => :string, | |
| :email => :string, | |
| :api_token => :string, | |
| :avatar_url_thumb => :url, | |
| :avatar_url_full => :url | |
| set_relationships :answers => :Answer, | |
| :spots => :Spot |
| (lldb) po [[UIApplication sharedApplication] windows] | |
| $13 = 0x09ee0630 <__NSArrayM 0x9ee0630>( | |
| <UIWindow: 0x9e8ff00; frame = (0 0; 320 568); layer = <UIWindowLayer: 0x9e90300>>, | |
| <UITextEffectsWindow: 0x9a77be0; frame = (0 0; 320 568); hidden = YES; opaque = NO; layer = <UIWindowLayer: 0x9a77d30>>, | |
| <_UIAlertOverlayWindow: 0x9edf900; frame = (0 0; 320 568); layer = <UIWindowLayer: 0x9edf9d0>> | |
| ) | |
| (lldb) po [[[UIApplication sharedApplication] windows] lastObject] | |
| $14 = 0x09edf900 <_UIAlertOverlayWindow: 0x9edf900; frame = (0 0; 320 568); layer = <UIWindowLayer: 0x9edf9d0>> | |
| (lldb) po [[[[UIApplication sharedApplication] windows] lastObject] subviews] |
| So there's this game called Monster Hunter. Think of it like the Japanese WOW. It is extremely addicting and can ruin your life. | |
| In the game, there are items called Charms, which you can think of like any other game accessory. | |
| A Charm has two components. It has -- | |
| 1. Slots | |
| 2. Skills | |
| The game is constrained in such a way that every charm has 1-2 to skills and 0-3 slots. |
| - (NSCachedURLResponse *) cachedResponseForRequest:(NSURLRequest *)request { | |
| NSCachedURLResponse *cachedURLResponse = [super cachedResponseForRequest:request]; | |
| if (cachedURLResponse == nil && [request.HTTPMethod isEqualToString:@"GET"]) { | |
| //[db executeQuery:@"select * from test where a = ?", @"hi'", nil]; | |
| FMResultSet *cfurl_cache_response = [self.db executeQuery:@"select * from cfurl_cache_response where request_key = ? limit 1", request.URL.absoluteString, nil]; | |
| if ([cfurl_cache_response next]) { | |
| id entry_ID = [cfurl_cache_response objectForColumnName:@"entry_ID"]; | |
| [cfurl_cache_response close]; | |
| if (entry_ID != [NSNull null]) { | |
| FMResultSet *cfurl_cache_blob_data = [self.db executeQuery:@"select * from cfurl_cache_blob_data where entry_ID = ? limit 1", entry_ID, nil]; |
| NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.organicshoppermag.com/assets/images/miso_img_large.gif"]]; | |
| NSURLResponse *response = nil; | |
| NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:NULL]; | |
| NSCachedURLResponse *cachedResponse = [[[NSCachedURLResponse alloc] initWithResponse:response data:data] autorelease]; | |
| NSLog(@"%u",cachedResponse.data.length); |