Skip to content

Instantly share code, notes, and snippets.

Quick trial.
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk
SWIFTCPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc
SDKPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk
OUTPUT_FILE_MAP_PATH=/Users/HHH/Library/Developer/Xcode/DerivedData/TestShellComponents-grlvlrksazfxqchfsqkhdbyqingh/Build/Intermediates/TestShellComponents.build/Debug-iphoneos/TestShellComponents.build/Objects-normal/arm64/TestShellComponents-OutputFileMap.json
EMIT_MODULE_PATH=/Users/HHH/Library/Developer/Xcode/DerivedData/TestShellComponents-grlvlrksazfxqchfsqkhdbyqingh/Build/I
@eonil
eonil / rsync
Last active June 8, 2017 18:33
rsync -avhc --stats --progress <src> <dest>
# archive
# verbose
# human readable
# checksum by MD5. if you dont use this, rsync won't verify equality.
# show overall stats
# show progress of each files.
javascript:(function(){$(".card-short-id").removeClass("hide");$(".card-short-id").css("padding-right", "4px");$(".card-short-id").css("font-weight", "bold");})()
@eonil
eonil / gist:f6031d17401bd167f28391ccd0642dbe
Created February 16, 2017 02:48
How to replace string in files in Bash...
find . -name *.json | xargs sed -i -e 's/\"AAA\"/\"BBB\"/g'
//
// FixedViewController.swift
// Editor4
//
// Created by Hoon H. on 2016/05/10.
// Copyright © 2016 Eonil. All rights reserved.
//
import Foundation
import AppKit
@eonil
eonil / MulticastStation
Created October 25, 2015 09:41
MulticastStation
public class MulticastStation<Parameter>: MulticastChannel<Parameter> {
public override init() {
}
public func cast(parameter: Parameter) {
_cast(parameter)
}
public var onDidRegister: ((Callback)->())? {
get {
return _onDidRegister
@eonil
eonil / 1. Source Code
Last active October 23, 2015 23:48
Swfit weak reference undefined behaviour case. (Swift 2.0)
class AAA {
deinit {
print("AAA deinit")
callbackOnDeinit!(self)
}
var callbackOnDeinit: (AAA->())?
}
@eonil
eonil / gist:628121a99c9d2dd85f21
Created June 3, 2015 13:20
Git Submodule How-To

To add a submodule, first move to the container directory, and type this.

git submodule add http://...

To sync the submodule working tree files to current branch'es current commit, type this.

git submodule update

Xcode Note

Xcode 6.3 (beta)

  • Do not import self module. It causes module-map related link error. For example, if your project's module name is Example1, do not import Example1 in source files in the project.

libclang Note

  • Use C API that is intended to be stable long term API.
  • C++ interfaces are not really an API. So it constantly changes.