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
static unsigned int readUInt(unsigned char *p, unsigned int offset, unsigned int bytes) | |
{ | |
unsigned int result = 0; | |
int i; | |
for (i = 0; i < bytes; ++i){ | |
result += p[offset + i] << ((bytes - i - 1) * 8); | |
} | |
return result; | |
} | |
static unsigned int readUIntLE(unsigned char *p, unsigned int offset, unsigned int bytes) |
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
ほむ | |
ほむほむ ほむほむ ほむ ほむほむほむ ほむ | |
ほむ ほむほむほむほむ ほむほむ ほむ ほむほむほむ ほむ ほむほむほむほむ ほむ ほむほむほむほむほむ ほむ ほむほむほむほむほむほむ ほむ ほむほむほむほむほむほむほむ ほむ ほむ ほむほむほむほむほむほむほむほむほむほむほむほむ ほむほむほむ ほむ ほむほむほむほむほむ ほむ ほむほむほむほむほむほむほむほむ ほむ ほむほむほむほむほむほむほむほむほむほむほむ ほむ ほむほむほむほむほむほむほむほむほむほむほむ ほむ ほむほむほむほむほむほむほむほむほむほむほむほむ ほむ ほむほむほむほむほむほむほむほむほむほむほむほむほむほむ ほむ ほむほむほむほむほむほむほむほむほむほむほむほむほむ ほむほむ ほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむ ほむ ほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむ ほむ ほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむ ほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむほむ ほむ ほむほむほむほむほむ ほむほむ ほむほむほむほむほむほむほむほむほむ ほむほむほむ ほむほむほむほむほむほむほむほむほむ ほむほむほむほむ ほむほむほむほむほむほむ ほむほむほむほむほむ ほむほむほむほむほむほむほむほむほむほむ ほむほむほむほむほむほむ ほむほむほむほむほむほむほむ ほむほむほむほむほむほむほむ ほむほむほむほむほむ ほむほむほむほむほむほむほむほむ ほむほむほむ |
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 "BJMasterViewController.h" | |
#import "BJDetailViewController.h" | |
#include <ifaddrs.h> | |
#include <sys/socket.h> | |
#include <net/if.h> | |
#include <net/if_dl.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.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
{ | |
"name": "AppGroup", | |
"version": "1.0.0", | |
"summary": "Injected podspec used by CocoaPods-AppGroup plugin.", | |
"description": "This is intended to be used as an injected podspec template \n used by the [CocoaPods-ApGroup plugin](https://github.com/mzp/cocoapods-app_group).\n\n It should *not* be referenced outside of that context. \n", | |
"homepage": "https://github.com/mzp/cocoapods-app_group", | |
"license": { | |
"type": "MIT", | |
"text": "MIT LICENSE Found in the repo" | |
}, |
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
// causes crash of swift-3.0-preview-1-SNAPSHOT-2016-05-31-a-osx and 2016-06-06 | |
// /Library/Developer/Toolchains/swift-3.0-preview-1-SNAPSHOT-2016-05-31-a.xctoolchain/usr/bin/swift swift3-preview1-crash-example1.swift | |
// /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-06-06-a.xctoolchain/usr/bin/swift swift3-preview1-crash-example1.swift | |
// removing any of Equatable or type constraints will make it | |
protocol P1 { | |
associatedtype A1: Equatable | |
} | |
class C1<T: Equatable> { |
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 | |
import NorthLayout | |
import Ikemen | |
class ViewController: UIViewController { | |
override func loadView() { | |
super.loadView() | |
func button(_ title: String, _ action: Selector) -> UIButton { |
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
FRAMEWORK_ARG=$(for f in $(echo "${FRAMEWORK_SEARCH_PATHS}"); do echo -n "-F$f "; done) | |
RUNPATH_ARG=$(for p in $(echo $LD_RUNPATH_SEARCH_PATHS); do echo -n "-Xlinker -rpath -Xlinker $p "; done) | |
LD="${DT_TOOLCHAIN_DIR}/usr/bin/clang -arch ${arch} -isysroot ${SDKROOT} -L${CONFIGURATION_BUILD_DIR} ${FRAMEWORK_ARG} -filelist ${LINK_FILE_LIST_normal_x86_64} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET} ${RUNPATH_ARG} -fobjc-link-runtime -L${DT_TOOLCHAIN_DIR}/usr/lib/swift/macosx -lc++ -framework Foundation -Xlinker -add_ast_path -Xlinker ${OBJECT_FILE_DIR_normal}/${arch}/${EXECUTABLE_NAME}.swiftmodule -Xlinker -dependency_info -Xlinker ${LD_DEPENDENCY_INFO_FILE} -o ${CONFIGURATION_BUILD_DIR}/${EXECUTABLE_NAME}" | |
echo "$LD" | |
zsh -c "$LD" | |
mkdir -p "${CONFIGURATION_BUILD_DIR}/Frameworks" | |
for f in ${CONFIGURATION_BUILD_DIR}/*/*.framework; do | |
cp -r "$f" "${CONFIGURATION_BUILD_DIR}/Frameworks/" | |
done |
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 Eureka | |
import SVProgressHUD | |
import BrightFutures | |
class ViewController: FormViewController { | |
init() { | |
super.init(style: .grouped) | |
} | |
required init?(coder aDecoder: NSCoder) { |
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
// the original code by apple and its license | |
// https://developer.apple.com/library/prerelease/content/samplecode/APFSCloning/Listings/clonefile_main_c.html#//apple_ref/doc/uid/TP40017341-clonefile_main_c-DontLinkElementID_5 | |
NSLog("%@", "\(ProcessInfo().operatingSystemVersion)") | |
/* Initailize state */ | |
let s = copyfile_state_alloc(); | |
let srcPath = NSHomeDirectory() + "/tmp/test.txt" | |
let copyPath = NSHomeDirectory() + "/tmp/test-copy.txt" |
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
class AppDelegate: NSResponder, NSTouchBarDelegate, NSApplicationDelegate { | |
@available(OSX 10.12.2, *) | |
lazy var touchbar: NSTouchBar = { | |
let tb = NSTouchBar() | |
tb.delegate = self | |
tb.defaultItemIdentifiers = [NSTouchBarItemIdentifier(rawValue: "test")] | |
return tb | |
}() |
OlderNewer