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
package main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
"strings" | |
"time" | |
) |
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 UIKit | |
public extension UIColor { | |
public func colorWithBrightness(brightness: CGFloat) -> UIColor { | |
var H: CGFloat = 0, S: CGFloat = 0, B: CGFloat = 0, A: CGFloat = 0 | |
if getHue(&H, saturation: &S, brightness: &B, alpha: &A) { | |
B += (brightness - 1.0) | |
B = max(min(B, 1.0), 0.0) | |
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
// | |
// RSASHA1.swift | |
// | |
// Copyright (c) 2015 Neil Cowburn. All rights reserved. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is |
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 Foundation | |
public let GCD_MAIN_QUEUE = dispatch_get_main_queue() | |
public let GCD_BACKGROUND_QUEUE = dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0) | |
public let GCD_LOW_PRIORITY_QUEUE = dispatch_get_global_queue(QOS_CLASS_UTILITY, 0) | |
public let GCD_DEFAULT_QUEUE = dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0) | |
public let GCD_HIGH_PRIORITY_QUEUE = dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0) | |
public func after(delay: NSTimeInterval, block: () -> ()) | |
{ |

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
public final class Promise<T> { | |
private var resolveClosure: (T -> Void)? | |
private var rejectClosure: (AnyObject? -> Void)? | |
public init() { } | |
public func then(resolve: (T -> Void), _ reject: (AnyObject? -> Void)? = nil) -> Promise<T> { | |
self.rejectClosure = reject | |
self.resolveClosure = resolve |
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 <Foundation/Foundation.h> | |
FOUNDATION_EXPORT BOOL NCIsAdHocReleaseBuild(); |
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
package net | |
import ( | |
"net" | |
"os" | |
) | |
func InterfaceIPv4Address(name string) net.IP { | |
intf, err := net.InterfaceByName(name) | |
if err != nil { |
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
LIB_TARGET_NAME="${PRODUCT_NAME}" | |
if [ "${ACTION}" = "clean" ] | |
then | |
echo "Cleaning Libraries..." | |
cd "${PROJECT_DIR}" | |
xcodebuild -target "$LIB_TARGET_NAME" -configuration ${CONFIGURATION} -sdk iphoneos clean | |
xcodebuild -target "$LIB_TARGET_NAME" -configuration ${CONFIGURATION} -sdk iphonesimulator clean | |
fi |