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)); |
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
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...: [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
// | |
// 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
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
// | |
// StringMaskFormatter.swift | |
// StringMaskFormatter | |
// | |
// Created by dede.exe on 10/07/16. | |
// It's totally base on article : "http://vojtastavik.com/2015/03/29/real-time-formatting-in-uitextfield-swift-basics/" | |
// And I don't mind if the original author should allow me(or not) to publish it :)... But I'll keep the reference | |
// | |
import UIKit |
OlderNewer