Skip to content

Instantly share code, notes, and snippets.

View below's full-sized avatar
💭
I love feedback on my ARM64 Repo

Alexander von Below below

💭
I love feedback on my ARM64 Repo
View GitHub Profile
@below
below / gist:1501383
Created December 20, 2011 12:17
Simple Script to set a version number in the Info Plist
# 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
@below
below / gist:3447720
Created August 24, 2012 08:51
Make less do more in OS X Terminal
# 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
@below
below / pseudo
Created October 21, 2013 11:19
Total Pseudocode
BOOL compilerSwitch = NO;
#ifdef __FOOCOMPILERDEFINE__
compilerSwitch = YES;
#endif
if (compilerSwitch || [self someOtherActivationLikeInAppPurchaseOrYouNameIt]) {
[MrScott energize];
}
@below
below / gist:7419166
Created November 11, 2013 19:44
Also er baut, und dann kommt plötzlich (und ohne Ausführung der Tests):
** 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`
@below
below / NEHotspotEnum.playground
Created March 3, 2016 09:33
Why is the NEHotspotHelperConfidence not nil if out of bounds?
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
}
@below
below / QueryPlayground.swift
Created July 26, 2016 21:18
Why is NSQueryItem not percent escaping "+" in a query?
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?
@below
below / ProtocolPlayground.swift
Created November 8, 2016 13:48
Why does this work if I test for the class, and not for the protocol?
//: Playground - noun: a place where people can play
import Foundation
protocol MyProtocol {
var value: Int! { get set }
}
class MyClass : MyProtocol {
var value : Int!
@below
below / Optional.swift
Created November 11, 2016 14:44
What the What?
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
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
@below
below / gist:ae461ff69141624494488fcfc9da4dc8
Last active March 3, 2017 14:45
gradlew task --info --debug --stacktrace
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/