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
#!/usr/bin/xcrun --sdk macosx swift | |
import Foundation | |
let fileManager = FileManager.default | |
//let currentPath = fileManager.currentDirectoryPath | |
let currentPath = "/Users/carlos/Pecunpay/GeltCash/Implementación/Geltcash" | |
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
# Uncomment the next line to define a global platform for your project | |
# platform :ios, '9.0' | |
target '%TargetName%' do | |
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks | |
use_frameworks! | |
# Pods for %TargetName% | |
# pod 'FBSDKCoreKit' | |
end |
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
function mkicns() { | |
if [[ -z "$@" ]]; then | |
echo "Input file missing" | |
else | |
filename=${1%.*} | |
mkdir $filename.iconset | |
sips -z 16 16 $1 --out $filename.iconset/icon_16x16.png | |
sips -z 32 32 $1 --out $filename.iconset/icon_16x16@2x.png | |
sips -z 32 32 $1 --out $filename.iconset/icon_32x32.png | |
sips -z 64 64 $1 --out $filename.iconset/icon_32x32@2x.png |
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
// Decorable Protocol -------------------------------------------------------------------- | |
protocol IBeverage { | |
func description() -> String | |
func cost() -> Double | |
} | |
extension IBeverage { | |
func printDescription() { |
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
protocol MyInterface { | |
func myMethod() -> String | |
} | |
extension MyInterface { | |
func myMethod() -> String { | |
fatalError("Not Implemented") |
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
//: Sample based on Function Composition snippet from objc.io: http://www.objc.io/snippets/2.html | |
import Foundation | |
func getContents(url: String) -> String { | |
return NSString(contentsOfURL: NSURL(string: url)!, encoding: NSUTF8StringEncoding, error: nil)! as String | |
} | |
func lines(input: String) -> [String] { | |
return input.componentsSeparatedByCharactersInSet(NSCharacterSet.newlineCharacterSet()) | |
} |