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
// define notification name as extension of Notification.Name | |
extension Notification.Name { | |
public static let ViewControllerDidUpdate = Notification.Name("ViewControllerDidUpdateNotification") | |
} | |
// post notification | |
NotificationCenter.default.post(Notification(name: .ViewControllerDidUpdate)) |
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 | |
# -*- coding: utf-8 -*- | |
require 'nokogiri' | |
path = ARGV.shift | |
doc = Nokogiri::XML(File.open(path)) | |
doc.xpath("/database/object").each do |object| | |
o = object.clone |
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> | |
@interface NSStream (Helper) | |
+ (NSString *)descriptionFromEvent:(NSStreamEvent)event; | |
@end | |
#import "NSStream+Helper.h" |
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
let n = 1234567890 | |
let formatter = NSNumberFormatter() | |
formatter.locale = NSLocale(localeIdentifier: "ja_JP") | |
formatter.numberStyle = .SpellOutStyle | |
let str = formatter.stringFromNumber(n) |
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
var <# name #>: <# type #> { | |
get { | |
return <# value #> | |
} | |
set(<# newValue #>) { | |
} | |
} |
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
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(<# after #> * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { | |
} |
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" | |
@interface ViewController () <UIViewControllerPreviewingDelegate> | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad |
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
# /bin/sh | |
# Generate universal 'fat' binary for libVVBasics, libVVOSC, libVVUIToolbox includes Bitcode | |
# Install xctool via homebrew before run this script. | |
# 1. Install homebrew from http://brew.sh | |
# 2. Install xctool $ brew install xctool | |
# 3. Run this script | |
xctool -workspace $PWD/VVOpenSource.xcodeproj/project.xcworkspace --scheme "vvopensource-Build iOS static libs" sdk iphonesimulator -configuration Release OTHER_CFLAGS="-fembed-bitcode -DIPHONE" OBJROOT=$PWD/build SYMROOT=$PWD/build ONLY_ACTIVE_ARCH=NO | |
xctool -workspace $PWD/VVOpenSource.xcodeproj/project.xcworkspace --scheme "vvopensource-Build iOS static libs" sdk iphoneos -configuration Release OTHER_CFLAGS="-fembed-bitcode -DIPHONE" OBJROOT=$PWD/build SYMROOT=$PWD/build ONLY_ACTIVE_ARCH=NO |
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 UIKit | |
class ViewController: UIViewController { | |
var oscIn:OSCInPort! | |
var oscOut:OSCOutPort! | |
var oscManager:OSCManager! | |
func setupOSC () -> Void { | |
oscManager = OSCManager() |
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
... | |
command script import ~/.lldb/print_json.py | |
# Then restart Xcode |
NewerOlder