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 needs to go into a script build phase prior to "Copying resources" | |
# Set the version from version.txt | |
product_version=`cat version.txt` | |
# Instead of version.txt, you can use whatever your filthy heart desires | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion \"$product_version\"" "$TARGET_BUILD_DIR/$INFOPLIST_PATH" | |
exit 0 |
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
# Configure less to register the represented file with the terminal. | |
if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then | |
export LESS='-P?n?f'"$(printf '\e]6;%%f\a')"'%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x..%t' | |
fi | |
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
BOOL compilerSwitch = NO; | |
#ifdef __FOOCOMPILERDEFINE__ | |
compilerSwitch = YES; | |
#endif | |
if (compilerSwitch || [self someOtherActivationLikeInAppPurchaseOrYouNameIt]) { | |
[MrScott energize]; | |
} |
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
** TEST SUCCEEDED ** | |
[FOO] $ /bin/bash -xe /var/folders/kx/gv59n06j26n3n1fwxsxctb_m0000gq/T/hudson2864317743272309338.sh | |
Recording test results | |
No test report files were found. Configuration error? | |
Build step 'Publish JUnit test result report' changed build result to FAILURE | |
Finished: FAILURE` |
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 NetworkExtension | |
//: First a classical enum. As documented, it will be nil if initialized with a rawValue outside of bounds | |
//: https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Enumerations.html | |
enum Foobar : Int { | |
case foo | |
case bar | |
} |
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 | |
let comps = NSURLComponents(string: "https://example.com") | |
comps?.queryItems = [NSURLQueryItem(name: "foobar", value: "foo+bar&something else")] | |
comps!.URL! | |
// Actual result: | |
// https://example.com?foobar=foo+bar%26something%20else | |
// As per https://tools.ietf.org/html/rfc3986#section-2.1 it | |
// appears that '+' should be escaped. What am I overlooking? |
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
//: Playground - noun: a place where people can play | |
import Foundation | |
protocol MyProtocol { | |
var value: Int! { get set } | |
} | |
class MyClass : MyProtocol { | |
var value : Int! |
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 Foundation | |
let scheme : String! = "https" // "https" | |
let host = "example.com" // "example.com" | |
let urlString = "\(scheme)://\(host)" // "Optional("https")://example.com" // <-- WHAT? | |
let url = URL(string: urlString) // nil |
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
Error:Unable to find method 'org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/HostnameVerifier;)V'. | |
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) | |
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. | |
<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li><li>Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes. | |
12:33 Gradle sync failed: Cause: org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/Hostn |
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
15:41:57.007 [LIFECYCLE] [org.gradle.launcher.daemon.client.SingleUseDaemonClient] To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html. | |
15:41:57.017 [DEBUG] [org.gradle.launcher.daemon.client.DefaultDaemonStarter] Using daemon args: [/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java, -Xmx1536m, -Dfile.encoding=UTF-8, -Duser.country=DE, -Duser.language=de, -Duser.variant, -cp, /Users/below/.gradle/wrapper/dists/gradle-2.14.1-all/8bnwg5hd3w55iofp58khbp6yv/gradle-2.14.1/lib/gradle-launcher-2.14.1.jar] | |
15:41:57.023 [INFO] [org.gradle.launcher.daemon.client.DefaultDaemonStarter] Starting daemon process: workingDir = /Users/below/.gradle/daemon/2.14.1, daemonArgs: [/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java, -Xmx1536m, -Dfile.encoding=UTF-8, -Duser.country=DE, -Duser.language=de, -Duser.variant, -cp, /Users/below/.gradle/wrapper/dists/gradle-2.14.1-all/ |