$ brew install rbenv
$ brew install ruby-build
$ brew install rbenv-gemset
$ brew install xcproj
$ rbenv install -l
$ rbenv install 2.3.1
$ rbenv versions
$ rbenv shell system
$ rbenv shell 2.3.1
This file contains hidden or 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
- App Entry Point | |
app_event_loop() | |
- Bluetooth module's sniff interval | |
void app_comm_set_sniff_interval(const SniffInterval interval) | |
SniffInterval app_comm_get_sniff_interval(void) | |
enum SniffInterval { | |
SNIFF_INTERVAL_NORMAL | |
SNIFF_INTERVAL_REDUCED |
This file contains hidden or 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
(when (require 'flymake nil 'noerror) | |
;; ignore syntax check error http://d.hatena.ne.jp/sugyan/20100705/1278306885 | |
(defadvice flymake-post-syntax-check (before flymake-force-check-was-interrupted) | |
(setq flymake-check-was-interrupted t)) | |
(ad-activate 'flymake-post-syntax-check) | |
;; swift | |
(defvar swift-sdk-path "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk") | |
(defvar swift-configure-target "i386-apple-ios8.1") | |
(defun flymake-swift-init () |
This file contains hidden or 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
$ xattr -p com.apple.TextEncoding ~/Desktop/myfile.txt | |
xattr: /Users/tanb/Desktop/myfile.txt: No such xattr: com.apple.TextEncoding | |
$ xattr -p com.apple.TextEncoding ~/Desktop/myfile.txt | |
SHIFT_JIS;2561 |
This file contains hidden or 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)initialize | |
{ | |
_singleton = @[@"hoge", | |
@(100), | |
[UIImage new]]; | |
} | |
+ (id)getSettingsAtIndex:(NSUInteger)index | |
{ | |
NSArray *settings = [[NSArray alloc] initWithArray:_singleton copyItems:YES]; |
This file contains hidden or 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
# root所有にしておかないと実行されない | |
sudo chown root ~/Library/LaunchAgents/me.tanb.sample.plist | |
sudo launchctl load ~/Library/LaunchAgents/me.tanb.sample.plist | |
This file contains hidden or 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
// MyViews.xib に複数のViewをいれました | |
NSArray *nibContents = [[NSBundle mainBundle] loadNibNamed:@"MyViews" owner:nil options:nil]; | |
// RestorationIDに適当な名前をつけておいて取り出しました | |
__block UIView *targetView = nil; | |
[nibContents enumerateObjectsUsingBlock:^(UIView *view, NSUInteger idx, BOOL *stop) { | |
if ([view.restorationIdentifier isEqualToString:@"MyView"]) { | |
*stop = YES; | |
targetView = (UIView *)view; | |
} |
This file contains hidden or 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
NSArray *fileURLs = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:self.url | |
includingPropertiesForKeys:[NSArray array] | |
options:0 | |
error:nil]; | |
[fileURLs enumerateObjectsUsingBlock:^(NSURL *fileURL , NSUInteger idx, BOOL *stop) { | |
NSImage *elementIcon = [[NSWorkspace sharedWorkspace] iconForFile:[fileURL path]]; | |
CFStringRef fileExtension = (__bridge CFStringRef)[fileURL pathExtension]; | |
CFStringRef fileUTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileExtension, NULL); | |
if (UTTypeConformsTo(fileUTI, kUTTypeImage)) { |
- Task typeを返す非同期メソッドを呼び出す
- 非同期処理の戻り値はTaskクラスのResultにセットされる.awaitがそれを返している.
- 非同期処理が終了するとawait以降のコードに処理が戻る
// これと
var worker = await TplWorker.DoWorkAsync();
ShowResult(worker);
This file contains hidden or 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
script import os, sys | |
# So that ~/lldbutils.py takes precedence. | |
script sys.path[:0] = [os.path.expanduser('~')] | |
script import lldbutils | |
command script add -f lldbutils.print_data_as_string_function pdas |