You may need to configure a proxy server if you're having trouble cloning
or fetching from a remote repository or getting an error
like unable to access '...' Couldn't resolve host '...'
.
Consider something like:
You can specify the underlying name for a C function the linker/compiler should actually use. If you use an existing | |
function's name, it will just let you refer to it with your prototype's name. If you define the function, it'll give | |
it that name. It even complains if a function of that name already exists. Tested with clang on a Mac, but AFAIK also | |
works in GCC. You can even use special characters in your function names, like you can do in assembly. |
#!/bin/sh | |
PLIST_BUDDY=/usr/libexec/PlistBuddy | |
xcode-plugin-add-compatibility() { | |
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \ | |
"$1/Contents/Info.plist" | |
} | |
xcode-plugin-has-compatibility() { |
/// Our custom drop-in replacement `precondition`. | |
/// | |
/// This will call Swift's `precondition` by default (and terminate the program). | |
/// But it can be changed at runtime to be tested instead of terminating. | |
func precondition(@autoclosure condition: () -> Bool, @autoclosure _ message: () -> String = "", file: StaticString = __FILE__, line: UWord = __LINE__) { | |
preconditionClosure(condition(), message(), file, line) | |
} | |
/// The actual function called by our custom `precondition`. | |
var preconditionClosure: (Bool, String, StaticString, UWord) -> () = defaultPreconditionClosure |
// Allow to use generics even if not supported yet | |
#if __has_feature(objc_generics) | |
#define NSArrayOf(x) NSArray<x> | |
#define NSMutableArrayOf(x) NSMutableArray<x> | |
#define NSDictionaryOf(x,y) NSDictionary<x, y> | |
#define NSMutableDictionaryOf(x, y) NSMutableDictionary<x, y> | |
#define NSSetOf(x) NSSet<x> | |
#define NSMutableSetOf(x) NSMutableSet<x> | |
#else | |
#define NSArrayOf(x) NSArray |
#Every Single Option Under The Sun
# View on GitHub: https://github.com/sharplet/Switch | |
# Try it yourself: git clone https://github.com/sharplet/Switch.git && cd Switch && rake | |
$ rake | |
mkdir -p Build | |
mkdir -p Build/Switch.framework | |
mkdir -p Build/Switch.framework/Versions/A/Modules/Switch.swiftmodule | |
ln -sf A Build/Switch.framework/Versions/Current | |
ln -sf Versions/Current/Modules Build/Switch.framework/Modules | |
ln -sf Versions/Current/Switch Build/Switch.framework/Switch | |
xcrun -sdk macosx swiftc -module-name Switch -emit-library -o Build/Switch.framework/Versions/Current/Switch -- Source/Array+Ext.swift Source/Option.swift Source/ParseResult.swift Source/Parser.swift Source/String+Ext.swift |
// | |
// main.swift | |
// mutablecomposition | |
// | |
// Created by Kevin Meaney on 24/08/2015. | |
// Copyright (c) 2015 Kevin Meaney. All rights reserved. | |
// | |
import Foundation |
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32 | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; The .data section is for storing and naming constants. | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
section .data | |
msg: db "Hello world!", 10 | |
.len: equ $ - msg |
// task_for_pid leak | |
// **IMPORTANT** To reproduce this bug, you have to sign this program with a developer ID -- do not use a self-signed certificate or run as root! | |
// This code will cause taskgated's memory usage to grow (see activity monitor) | |
// Link to Xcode project with included info.plist: http://tinyurl.com/kps28av | |
// Radar 16230826 | |
#include <mach/mach_init.h> | |
#include <mach/task.h> | |
#include <mach/mach_port.h> |