This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"MY-SUPERDUPER-ID"]; | |
[[GAI sharedInstance] ASM_setDefaultTracker:tracker]; | |
[[GAI sharedInstance] ASM_startAutomaticSessionManagement]; | |
// do usual stuff... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OK | |
//UIImage *image = [UIImage imageNamed:@"bg"]; | |
//UIImage *image = [[UIImage imageNamed:@"bg"] stretchableImageWithLeftCapWidth:0 topCapHeight:11]; | |
//UIImage *image = [[UIImage imageNamed:@"bg"] stretchableImageWithLeftCapWidth:11 topCapHeight:11]; | |
//UIImage *image = [[UIImage imageNamed:@"bg"] resizableImageWithCapInsets:UIEdgeInsetsMake(11.0f, 0, 11.0f, 0)]; | |
//UIImage *image = [[UIImage imageNamed:@"bg"] resizableImageWithCapInsets:UIEdgeInsetsMake(11.0f, 11.0f, 11.0f, 0)]; | |
UIImage *image = [[UIImage imageNamed:@"bg"] resizableImageWithCapInsets:UIEdgeInsetsMake(11.0f, 0, 11.0f, 11.0f)]; | |
// NG | |
//UIImage *image = [[UIImage imageNamed:@"bg"] resizableImageWithCapInsets:UIEdgeInsetsMake(11.0f, 11.0f, 0, 0)]; | |
//UIImage *image = [[UIImage imageNamed:@"bg"] resizableImageWithCapInsets:UIEdgeInsetsMake(11.0f, 11.0f, 11.0f, 11.0f)]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CocoaPods could completely break up your MyProject.xcodeproj to the state where even CocoaPods itself can't fix it, | |
# (for example, losing PODS_ROOT configulations) | |
# if you specify some broken Podfile. Adding `target "xxx" do ~ end` structure to your Podfile might be a trigger of this. | |
# So here's a tip: DO NOT ADD `target` unless absolutely nessessary. | |
#-------------------------------------------------------------------------------- | |
# WORKED | |
platform :ios, "7.0" | |
target "MyProject" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// objsushi.h | |
// Objective-🍣 | |
// | |
// Created by akisute on 2014/04/01. | |
// Copyright (c) 2014年 akisute. All rights reserved. | |
// | |
#ifndef objsushi | |
#define objsushi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MyComparator implements Comparator<MyClass> { | |
@Override | |
public int compare(MyClass obj1, MyClass obj2) { | |
int value1 = obj1.getValue(); | |
int value2 = obj2.getValue(); | |
// Dumb way | |
if (value1 == value2) { | |
return 0; | |
} else if (value1 > value2) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int getCryptoTypeDumb() { | |
// With Plain Java | |
List<Network> networkList = new ArrayList(mNetworkSet); | |
Collections.sort(networkList, NetworkComparators.CRYPTOTYPE_WEAKEST_TO_STRONGEST); | |
return networkList.get(0).getCryptoType(); | |
} | |
public int getCryptoType() { | |
// With Google Guava | |
return Ordering.from(NetworkComparators.CRYPTOTYPE_WEAKEST_TO_STRONGEST).min(mNetworkSet).getCryptoType(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Initialize engine version: 4.3.3f1 (c8ca9b6b9936) | |
GfxDevice: creating device client; threaded=1 | |
OpenGL: | |
Version: OpenGL 2.1 [2.1 NVIDIA-8.24.9 310.40.25f01] | |
Renderer: NVIDIA GeForce GTX 680MX OpenGL Engine | |
Vendor: NVIDIA Corporation | |
VRAM: 2048 MB | |
Extensions: GL_ARB_color_buffer_float GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_seamless_cube_map GL_ARB_shader_objects GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
var l = [ | |
"abesi", | |
"hidebu", | |
"tawaba", | |
] | |
var m = [ | |
"abesi": 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass { | |
var someValue:Int | |
func someMethod() -> Int { | |
return 42 | |
} | |
var callback:(Int) -> (Void) = {(value:Int) -> (Void) in | |
// Using self within a closure owned by self makes reference loop | |
self.someValue = self.someMethod() + value | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Rank:Int { | |
case Ace = 1 | |
case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten | |
case Jack, Queen, King | |
// Here's an undocumented trick: How to enumerate enums using Generator! | |
// I wish I could use yield though ;( | |
class EnumGenerator:Generator { | |
var i = 1 | |
func next() -> Rank? { |
OlderNewer