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
extension String { | |
private static let wordLikeRegex = /([A-Z]+[^A-Z\s_]+)|(?:[\s_]|^)+([^A-Z\s_]+)/ | |
/// Creates a copy of the current string by turning into snake case | |
/// | |
/// ## Example | |
/// ```swift | |
/// // Outputs: my_spaced_name24_long_string | |
/// "My SpacedName24_Long_____String".snakeCased() | |
/// ``` |
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
// | |
// AsynchronousBlockOperation.swift | |
// | |
// Created by Jose Canepa on 12/13/17. | |
// Copyright © 2017 Jose Canepa. All rights reserved. | |
// | |
import Foundation | |
/// Block based version of the AsynchronousOperation |
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
// MARK: - Protocol Declaration | |
public protocol InterfaceBuilderInstantiable | |
{ | |
/// The UINib that contains the view | |
/// | |
/// Defaults to the swift class name if not implemented | |
static var associatedNib : UINib { get } | |
} |
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
{ | |
"activity_tree":{ | |
"uuid":"c5fe79ec-285f-4c72-a438-9b930e776105", | |
"name":"Tarea para probar executions", | |
"core_activity":false, | |
"instructions":"Verificar que haya registro de esta tarea en la tabla executions", | |
"company_uuid":"ab30c859-9d04-4993-b7f6-8b8c9f0b6561", | |
"creator_uuid":"1302e9d1-df3c-4e4b-891f-7670a1f1db18", | |
"reference_file":"development-neo-frogmi/company_ab30c859-9d04-4993-b7f6-8b8c9f0b6561/activity_c5fe79ec-285f-4c72-a438-9b930e776105/assets/14876918417d83730f_kat_von_d_5.jpg", | |
"respond_after_deadline":false, |
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
String(format: "The value of life is %(life)$d", ["life":42]) | |
// "The value of life is 42" | |
String(format: "¿Dónde está %(firstname)$@ %(lastname)$@?", ["firstname":"Carmen", "lastname":"San Diego"]) | |
// "¿Dónde está Carmen San Diego?" | |
String(format: "PI is %(pi)$.4f", ["pi":Double.pi]) | |
// "PI is 3.1416" | |
String(format: "But PI can also be %(pi)$.f, or %(pi)$.5f, depending how you format it", ["pi":Double.pi]) |
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
override func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes? | |
{ | |
guard let collectionView = collectionView else { return nil } | |
let attributes = OnboardingTutorialAttributes(forCellWithIndexPath: indexPath) | |
// Bounds independant of scroll offset | |
let bounds = CGRect(origin: CGPoint.zero, size: collectionView.frame.size) | |
var frame : CGRect = CGRect.zero | |
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
required init?(coder decoder: NSCoder) | |
{ | |
super.init(coder: decoder) | |
prepareSubviews() | |
} | |
override init(frame: CGRect) | |
{ | |
super.init(frame: frame) | |
prepareSubviews() |
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
// | |
// DisplayLink.swift | |
// MetalMac | |
// | |
// Created by Jose Canepa on 8/18/16. | |
// Copyright © 2016 Jose Canepa. All rights reserved. | |
// | |
import AppKit |
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 | |
public extension UIColor | |
{ | |
class func components(alphaHex hex : UInt32) -> (r:UInt8, g:UInt8, b:UInt8, a:UInt8) | |
{ | |
let r = UInt8((hex & 0xFF000000) >> 24) | |
let g = UInt8((hex & 0x00FF0000) >> 16) | |
let b = UInt8((hex & 0x0000FF00) >> 8) | |
let a = UInt8((hex & 0x000000FF)) |
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
// | |
// main.c | |
// ObviousHomeworkFucboi | |
// | |
// Created by Can on 3/9/15. | |
// Copyright (c) 2015 Can. All rights reserved. | |
// | |
#include <stdio.h> |
NewerOlder