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
// Playground - noun: a place where people can play | |
import Foundation | |
typealias Byte = UInt8 | |
protocol GenericIntegerType: IntegerType { | |
init(_ v: Int) | |
init(_ v: UInt) | |
init(_ v: Int8) |
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
# Shell script for building Boost C++ for iOS (armv7, armv7s, arm64), the iOS Simulator | |
# (i386, x86_64), and Mac OSX (i386, x86_64). | |
# | |
# Creates a set of universal libraries and a pseudo-framework to facilitate using | |
# Boost C++ in Xcode. | |
# | |
# To configure the script, define: | |
# | |
# BOOST_VERSION Boost C++ version (e.g. 1.57.0) | |
# BOOST_LIBS: which Boost C++ libraries to build |
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
require 'coreaudio' | |
dev = CoreAudio.default_output_device | |
buf = dev.output_loop(44000) | |
line = ARGV[0] | |
puts line | |
44000.times do |t| | |
# buf[i] = 0x3FFF * rand() |
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
import os | |
import csv | |
from subprocess import Popen, PIPE | |
from Foundation import NSMutableDictionary | |
build_number = os.popen4("git rev-parse --short HEAD")[1].read() | |
info_plist = os.environ['BUILT_PRODUCTS_DIR'] + "/" + os.environ['WRAPPER_NAME'] + "/Info.plist" | |
# Open the plist and write the short commit hash as the bundle version | |
plist = NSMutableDictionary.dictionaryWithContentsOfFile_(info_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
#import <UIKit/UIKit.h> | |
@interface UIWebView (Additions) | |
/*! | |
@abstract Enable/Disable the receiver from scrolling. | |
*/ | |
@property (nonatomic, assign) BOOL webViewScrollEnabled; |
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
/* | |
* BeginEnd.h | |
* GLBeginEnd | |
* | |
* Created by narumij on 10/05/18. | |
* Copyright 2010 narumij. All rights reserved. | |
* | |
*/ | |
// http://d.hatena.ne.jp/narumij/20100518/1274190881 |
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)removeObjectForKey:(NSString*)key { | |
#if !TARGET_IPHONE_SIMULATOR | |
@synchronized(self) { | |
if (!deleteQueryDictionary) { | |
deleteQueryDictionary = [[NSMutableDictionary alloc]initWithObjectsAndKeys: | |
(id)kSecClassGenericPassword, (id)kSecClass, | |
key, (id)kSecAttrAccount, | |
(id)kSecMatchLimitAll, (id)kSecMatchLimit, | |
(id)kCFBooleanTrue, (id)kSecReturnAttributes, | |
nil]; |
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
/* | |
NSData+XMLParser | |
Simple XML Parser for iPhone | |
Usage: | |
* -I /usr/include/libxml2 | |
* -L libxml2 |
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
/* | |
* 元ネタ:C++ で気軽に時間測定がしたい | |
* http://d.hatena.ne.jp/iwiwi/20100221/1266682598 | |
* | |
* ブロック内で標準エラー出力へ出力していたり,入れ子的に使ったりすると, | |
* 表示がおかしなことになってしまうという問題への対策を施したコード | |
* Twitter: http://twitter.com/qnighy/status/9423778596 | |
*/ | |
#include <cstdio> | |
#include <sys/time.h> |