Skip to content

Instantly share code, notes, and snippets.

View bguidolim's full-sized avatar

Bruno Guidolim bguidolim

View GitHub Profile
[INFO] :   {
[INFO] :   localPlayer = {
[INFO] :   formattedValue = "28,545 points";
[INFO] :   rankPosition = 1;
[INFO] :   value = 28545;
[INFO] :   };
[INFO] :   playersInfo = (
[INFO] :   {
[INFO] :   alias = Bigola;
[INFO] :   displayName = Me;
var Mods = require('/ModulePaths');
var Map = require('com.guidolim.ticlusteredmapkit');
var mapview = Map.createView({
mapType:Map.NORMAL_TYPE,
width: Ti.UI.FILL,
height: Ti.UI.FILL
});
var data = Array();
int quizResult = [self.quizScore intValue];
if ( quizResult <= 10 ) {
self.lblResult.text = @"Você não foi nada bem!";
} else if ( quizResult <= 30 ) {
self.lblResult.text = @"Ainda podemos melhorar!";
} else if ( quizResult < 50 ) {
self.lblResult.text = @"Por pouco!";
} else if ( quizResult <= 70 ) {
self.lblResult.text = @"Bom desempenho!";
//Tabbar
#define kTabBarSelectedColor [UIColor colorWithRed:17.0/255.0 green:169.0/255.0 blue:222.0/255.0 alpha:1.0]
#define kTabBarUnselectedColor [UIColor colorWithRed:77.0/255.0 green:77.0/255.0 blue:77.0/255.0 alpha:1.0]
//Essas duas cores são na Tabbar (barra inferior) com as 3 opcoes, meus cursos, loja e ajustes.
// A primeira cor é a cor selecionada, a segunda é a não selecionada
//Font Color
#define kMainFontColor [UIColor colorWithRed:77.0/255.0 green:77.0/255.0 blue:77.0/255.0 alpha:1.0]
// Essa seria a cor padrão de fonte, creio que seria a cor cinza escuro lá. Se você observar, é igual a cor de cima ai.

Keybase proof

I hereby claim:

  • I am bguidolim on github.
  • I am bguidolim (https://keybase.io/bguidolim) on keybase.
  • I have a public key ASDqo6vFX8iyp8dcNkVorpT8yjJg3xH3U1nMydaCh8qPOwo

To claim this, I am signing this object:

@bguidolim
bguidolim / HTTPStatusCode.swift
Created April 20, 2018 13:38 — forked from ollieatkinson/HTTPStatusCode.swift
HTTP status codes as a Swift enum.
/// This is a list of Hypertext Transfer Protocol (HTTP) response status codes.
/// It includes codes from IETF internet standards, other IETF RFCs, other specifications, and some additional commonly used codes.
/// The first digit of the status code specifies one of five classes of response; an HTTP client must recognise these five classes at a minimum.
enum HTTPStatusCode: Int, Error {
/// The response class representation of status codes, these get grouped by their first digit.
enum ResponseType {
/// - informational: This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line.
case informational
@bguidolim
bguidolim / FilePreview.swift
Last active June 7, 2023 01:49
FilePreview is a easy way to open in-app some kind of files (PDF, DOC, XLS, TXT, images, etc) as read only. This is a simple implementation using WKWebView but with an interface to check if is possible to open the file before showing the ViewController.
//
// FilePreview.swift
// COYO Messenger Framework
//
// Created by Bruno Guidolim on 21.11.18.
// Copyright © 2018 COYO. All rights reserved.
//
import Foundation
import WebKit
import UIKit
let userJson = """
{
"id": "4yq6txdpfadhbaqnwp3",
"age": 5,
"name":"John Doe",
"properties": {
"dynamicKeyA": "1",
"dynamicKeyB": "2",
@bguidolim
bguidolim / ChatCollectionViewFlowLayout.swift
Created November 9, 2019 01:59
Link Preview implementation using MessageKit
//
// ChatCollectionViewFlowLayout.swift
// Engage
//
// Created by Bruno Guidolim on 04.08.19.
// Copyright © 2019 COYO GmbH. All rights reserved.
//
import MessageKit
extension String {
/// Check if a string contains in other string considering a minimum match percentage.
/// - Parameters:
/// - string: String that should be tested.
/// - matchPercentage: The minimum match percentage.
/// - Returns: Boolean indication if the requeriment was matched.
public func contains(_ string: String, matchPercentage: Float) -> Bool {
let set1 = Set<String>(self.components(separatedBy: .whitespaces))
let set2 = Set<String>(string.components(separatedBy: .whitespaces))
let match: Set<String> = set1.intersection(set2)