This file contains hidden or 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 GCDWebServer | |
| class CorsProxy { | |
| init(webserver : GCDWebServer!, urlPrefix: String) { | |
| var prefix = | |
| (urlPrefix.hasPrefix("/") ? "" : "/") | |
| + urlPrefix | |
| + (urlPrefix.hasSuffix("/") ? "" : "/") | |
| let pattern = "^" + NSRegularExpression.escapedPatternForString(prefix) + ".*" |
This file contains hidden or 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 Darwin | |
| let handle = dlopen("/usr/lib/libc.dylib", RTLD_NOW) | |
| let sym = dlsym(handle, "random") | |
| let functionPointer = UnsafeMutablePointer<() -> CLong>(sym) | |
| let result = functionPointer.memory() | |
| println(result) |
This file contains hidden or 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 | |
| PLIST_BUDDY=/usr/libexec/PlistBuddy | |
| function add_compatibility() { | |
| "$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \ | |
| "$1/Contents/Info.plist" | |
| } | |
| function has_compatibility() { |