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 Foundation | |
extension String { | |
func toFloat() -> Float | |
{ | |
return (self as NSString).floatValue | |
} | |
func toDouble() -> Double |
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
// | |
//temperaturas.swift | |
//Autor....: dede.exe | |
//E-mail...: dede.exe@gmail.com | |
//Descrição: Convertendo temperaturas em Swift | |
// | |
class Medida | |
{ | |
var valor : Float = 0.0 |
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
#!/bin/bash | |
#conversor.sh | |
#Author.....: dede.exe | |
#E-mail.....: dede.exe@gmail.com | |
#Description: Convert all files to a another format | |
# It's not a safe way to do it... | |
# Just a desperate script to save my life... | |
# Use it such a last resort... | |
to_format="utf8" |
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 { | |
var base64 : String? | |
{ | |
if let convertedData = self.dataUsingEncoding(NSUTF8StringEncoding) | |
{ | |
let convertedDataBase64 = convertedData.base64EncodedDataWithOptions(NSDataBase64EncodingOptions(rawValue: 0)) | |
let stringBase64 = String(data: convertedDataBase64, encoding: NSUTF8StringEncoding) | |
return stringBase64 |
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 Dictionary { | |
func joinKeyValuesFor(keyValueToken : String, groupedByToken:String ) -> String | |
{ | |
var str = "" | |
for (key, value) in self | |
{ | |
if str != "" | |
{ |
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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Great tutorial: http://www.raywenderlich.com/22167/beginning-core-image-in-ios-6 | |
// Official docs: https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/CoreImaging/ci_intro/ci_intro.html#//apple_ref/doc/uid/TP30001185-CH1-TPXREF101 | |
// Alt-click on function names for more! | |
// Make any old label, with our frame set to the view so we know it's there. | |
UILabel *label = [[UILabel alloc] initWithFrame:self.view.frame]; |
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 | |
extension UIView { | |
private struct FloatingKeys { | |
static var FKCompletion : String = "FKCompletion" | |
} | |
private class CompletionWrapper { | |
private var completion : (()->Void)? = nil |
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
// | |
// UIColor+Literals.swift | |
// Created by dede.exe | |
// | |
import UIKit | |
public extension UIColor { | |
public convenience init(red:Int, green:Int, blue:Int, percentAlpha:Int = 100) | |
{ |
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 Darwin | |
enum Signal: Int32 { | |
case HUP = 1 | |
case INT = 2 | |
case QUIT = 3 | |
case ABRT = 6 | |
case KILL = 9 | |
case ALRM = 14 | |
case TERM = 15 |
OlderNewer