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 "ViewController.h" | |
#import <CoreMotion/CoreMotion.h> | |
@implementation ViewController | |
{ | |
CMMotionManager *motionManager; | |
} | |
- (void)hoge | |
{ | |
NSLog(@"hoge"); |
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
/* | |
UIColorからR,G,B,Alphaの値を取得する | |
iOS SDK 5.0 以降が必要 | |
*/ | |
// サンプルのUIColor | |
//[UIColor whitecolor]の場合カラースペースが異なるため取得できない | |
UIColor *color = [UIColor redColor]; | |
// 取得した値を保存する変数 |
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/Foundation.h> | |
#import <stdio.h> | |
@interface RGB : NSObject | |
{ | |
unsigned char red, green, blue; | |
} | |
- (id)initWithRed:(int)r green:(int)g blue:(int)b; | |
- (id)blendColor:(RGB *)color; | |
- (void)print; |
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
- (void) redirectConsoleLogToDocumentFolder | |
{ | |
//ログを出力する | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *documentsDirectory = [paths objectAtIndex:0]; | |
NSString *logPath = [documentsDirectory stringByAppendingPathComponent:@"console.log"]; | |
freopen([logPath cStringUsingEncoding:NSASCIIStringEncoding],"a+",stderr); | |
NSLog(@"Start Logging"); | |
//バージョン情報をログに出力 |
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
// | |
// | |
// Created by nori on 2012/12/21. | |
// Copyright (c) 2012年 nori. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIApplication(LoggerExtention) | |
+ (void)startLogging; |
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
tell application "System Events" | |
tell current location of network preferences | |
set VPN to service "VPN" | |
if exists VPN then connect VPN | |
repeat while (current configuration of VPN is not connected) | |
delay 1 | |
end repeat | |
end tell | |
end tell |
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
tell application "System Events" | |
tell current location of network preferences | |
set VPN to service "VPN" | |
if exists VPN then disconnect VPN | |
end tell | |
end tell |
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
Bastille – Pompeii | |
Jack White – Lazaretto | |
Beck – Gamma Ray | |
OneRepublic – Counting Stars | |
MGMT – Electric Feel | |
Sbtrkt – Wildfire (feat. Little Dragon) | |
Wilco – You Never Know | |
Mumford & Sons – I Will Wait | |
Gorillaz – Stylo (feat. Mos Def and Bobby Womack) | |
Daft Punk – Instant Crush |
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
// Array to NSData | |
var cArray:Array<UInt8> = [0x01, 0x02, 0x03] | |
var data = NSData(bytes:cArray, length:sizeof(UInt8) * cArray.count) | |
println(data) | |
// NSData to Array | |
var bufferArray:Array<UInt8> = [0x00, 0x00, 0x00] | |
data.getBytes(&bufferArray, length:3) | |
println(bufferArray) | |
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
// Playground - noun: a place where people can play | |
import UIKit | |
var str = "Hello, playground" | |
class Counter:NSObject, NSCopying{ | |
var count = 0; | |
func add(){ |
OlderNewer