Skip to content

Instantly share code, notes, and snippets.

View carlosypunto's full-sized avatar

Carlos García carlosypunto

View GitHub Profile
@carlosypunto
carlosypunto / clean_localizable.swift
Created December 8, 2019 07:04
Localizable string checker script for use in Xcode project Build Phases
#!/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"
@carlosypunto
carlosypunto / Podfile
Created September 14, 2018 14:30 — forked from arturgrigor/Podfile
Sample Podfile for silencing warnings for CocoaPods dependencies
# 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
@carlosypunto
carlosypunto / mkicns.sh
Created December 18, 2017 12:50
Function to quickly create an application icon from 1024px master file
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
@carlosypunto
carlosypunto / mount-vm-sharedfolders.conf
Last active January 16, 2017 00:33
Mount/unmout vmware shared folders on home directory with owner uid and gid when start/stop Ubuntu desktop session
start on desktop-start
stop on desktop-end
script
vmhgfs-fuse -o uid=`id -u` -o gid=`id -g` ~/vmshare
end script
@carlosypunto
carlosypunto / gist.swift
Last active March 23, 2018 06:03
Swift 2 Multiparadigm Decorator Pattern
// Decorable Protocol --------------------------------------------------------------------
protocol IBeverage {
func description() -> String
func cost() -> Double
}
extension IBeverage {
func printDescription() {
@carlosypunto
carlosypunto / gist.swift
Last active April 19, 2016 04:08
Swift 2 Abstarct Class
protocol MyInterface {
func myMethod() -> String
}
extension MyInterface {
func myMethod() -> String {
fatalError("Not Implemented")
//: 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())
}