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
// | |
// FocusView.swift | |
// CustomNavigation | |
// | |
// Creating a CustomFocusView | |
// This code shows how to implement a custom view that can be focused in tvOS | |
// Just set this class as an UIView's custom class | |
// | |
import UIKit |
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...: [email protected] | |
//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
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
#!/bin/bash | |
#conversor.sh | |
#Author.....: dede.exe | |
#E-mail.....: [email protected] | |
#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
#include <string> | |
#include <iostream> | |
// | |
//Left trim | |
// | |
std::string trim_left(const std::string& str) | |
{ | |
const std::string pattern = " \f\n\r\t\v"; | |
return str.substr(str.find_first_not_of(pattern)); |
NewerOlder