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
require 'rbconfig' | |
ruby_path = File.join(Config::CONFIG["bindir"], | |
Config::CONFIG["RUBY_INSTALL_NAME"]+ | |
Config::CONFIG["EXEEXT"]) | |
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
# Get path of currently-executing Ruby interpreter | |
# 現在実行中のRubyインタプリタのパスを取得する | |
require 'rbconfig' | |
ruby_path = File.join(Config::CONFIG["bindir"], | |
Config::CONFIG["RUBY_INSTALL_NAME"]+ | |
Config::CONFIG["EXEEXT"]) | |
p ruby_path // disp got ruby path |
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
# require 'rubygems' | |
require 'hotcocoa' | |
include HotCocoa | |
require 'pp' | |
# framework 'Cocoa' | |
# framework 'CoreServices' | |
# hoge = DictionaryServices.new | |
# .DCSCopyTextDefinition(None, word, (0,len(word))) |
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
// | |
// AsyncImageView.h | |
// Postcard | |
// | |
// Created by markj on 2/18/09. | |
// Copyright 2009 Mark Johnson. You have permission to copy parts of this code into your own projects for any use. | |
// www.markj.net | |
// | |
// See |
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
. | |
|-- .DS_Store | |
|-- Cache.app | |
| |-- Cache | |
| |-- Info.plist | |
| |-- MainWindow.nib | |
| `-- PkgInfo | |
|-- Documents | |
|-- Library | |
| |-- .DS_Store |
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
#include <sys/xattr.h> | |
/// Set a flag that the files shouldn't be backuped to iCloud. | |
+ (void)addSkipBackupAttributeToFile:(NSString *)filePath { | |
u_int8_t b = 1; | |
setxattr([filePath fileSystemRepresentation], "com.apple.MobileBackup", &b, 1, 0, 0); | |
} | |
/// Returns the legacy storage path, used when the com.apple.MobileBackup file attribute is not available. | |
+ (NSString *)legacyStoragePath { |
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 Naoki TSUTSUI on 11/12/04. | |
// | |
/* | |
以下のコードは、実際に動作しているコードからの抜粋ですので、このままでは | |
動作しないかもしれません。fetchPdfFromServerのみ参考にしてください。 | |
インジケータ表示にMBProgressHUDを使用していますが、必要なければ該当コード | |
を削除してください。 | |
*/ |
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)sampleAddAttributeToFolder | |
{ | |
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
NSString *baseDir = [self paperStandDocumentsBasePath]; | |
NSError *error; | |
BOOL result = [fileManager createDirectoryAtPath:baseDir | |
withIntermediateDirectories:YES | |
attributes:nil | |
error:&error]; | |
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
#!/usr/bin/env ruby | |
############################################################################## | |
# Xcodeの環境変数表示 | |
############################################################################## | |
puts "PATH = #{ENV['PATH']}" | |
puts "LANG = #{ENV['LANG']}" | |
puts "IPHONEOS_DEPLOYMENT_TARGET = #{ENV['IPHONEOS_DEPLOYMENT_TARGET']}" | |
puts "ACTION = #{ENV['ACTION']}" |
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
// | |
// Utils.m | |
// StoreKitEventChecker | |
// | |
// Created by Naoki TSUTSUI on 12/01/30. | |
// | |
#import "Utils.h" | |
#include <objc/runtime.h> |
OlderNewer