Skip to content

Instantly share code, notes, and snippets.

View nolili's full-sized avatar
:octocat:

NORITAKA KAMIYA nolili

:octocat:
View GitHub Profile
@nolili
nolili / Notification.swift
Created August 11, 2016 06:23
Notification on Swift 3
// 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))
@nolili
nolili / migpo.rb
Created May 6, 2016 04:00 — forked from laiso/migpo.rb
#!/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
@nolili
nolili / gist:355ed163aa5dac77dfe9
Created February 10, 2016 07:04
NSStream Debugging (Helper)
#import <Foundation/Foundation.h>
@interface NSStream (Helper)
+ (NSString *)descriptionFromEvent:(NSStreamEvent)event;
@end
#import "NSStream+Helper.h"
let n = 1234567890
let formatter = NSNumberFormatter()
formatter.locale = NSLocale(localeIdentifier: "ja_JP")
formatter.numberStyle = .SpellOutStyle
let str = formatter.stringFromNumber(n)
@nolili
nolili / gist:5d727602a69718b8e001
Created December 7, 2015 01:01
Swift getter/setter
var <# name #>: <# type #> {
get {
return <# value #>
}
set(<# newValue #>) {
}
}
@nolili
nolili / dispatch_after.swift
Created October 18, 2015 12:59
dispatch_after Swift
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(<# after #> * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) {
}
@nolili
nolili / ViewController.m
Created September 26, 2015 06:53
3D touch Example
#import "ViewController.h"
@interface ViewController () <UIViewControllerPreviewingDelegate>
@end
@implementation ViewController
- (void)viewDidLoad
@nolili
nolili / build_fat_binary.sh
Last active August 7, 2016 12:48
Build fat binary(simulator/arm with bitcode) for VVOpenSource
# /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
@nolili
nolili / ViewController.swift
Created September 25, 2015 17:41
VVOSC + Swift
import UIKit
class ViewController: UIViewController {
var oscIn:OSCInPort!
var oscOut:OSCOutPort!
var oscManager:OSCManager!
func setupOSC () -> Void {
oscManager = OSCManager()
@nolili
nolili / .lldbinit
Last active September 17, 2015 04:38 — forked from jparishy/.lldbinit
Print JSON from LLDB
...
command script import ~/.lldb/print_json.py
# Then restart Xcode