This file contains hidden or 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
public class ReflectionGenerator { | |
/// Represents the percentile chance of a "ok" response. | |
static var CHANCE_OK_RESPONSE: Int = 10 | |
private static let PRHASES: [String] = [ | |
"Excelente! Continue assim.", | |
"Normal encontrar dificuldades no meio do caminho, mas podemos sempre ajustar o planejamento nestes casos.", | |
"Não se preocupe, você pode ajustar a entrega para amanhã pensando nisso.", | |
"Achei que seu desempenho hoje deixou um pouco a desejar, o que acha de melhorar o planejamento para amanhã?", | |
"Muito bem! Mas vamos tentar novos formatos?", |
This file contains hidden or 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
if TARGET_IPHONE_SIMULATOR != 1 { | |
// Check 1 : existence of files that are common for jailbroken devices | |
if FileManager.default.fileExists(atPath: "/Applications/Cydia.app") | |
|| FileManager.default.fileExists(atPath: "/Library/MobileSubstrate/MobileSubstrate.dylib") | |
|| FileManager.default.fileExists(atPath: "/bin/bash") | |
|| FileManager.default.fileExists(atPath: "/usr/sbin/sshd") | |
|| FileManager.default.fileExists(atPath: "/etc/apt") | |
|| FileManager.default.fileExists(atPath: "/private/var/lib/apt/") | |
|| UIApplication.shared.canOpenURL(URL(string: "cydia://package/com.example.package")!) { | |
return true |
This file contains hidden or 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 | |
enum RequestDefinition { | |
case example(parameter: String) | |
var url: URL { | |
var urlComponents = URLComponents() | |
urlComponents.scheme = "https" | |
urlComponents.host = "example.com" |
This file contains hidden or 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
\documentclass[12pt]{article} | |
\usepackage{sbc-template} | |
\usepackage{graphicx,url} | |
\usepackage[utf8]{inputenc} | |
\usepackage[brazil]{babel} | |
\sloppy | |
\title{Decomposição de um web server em microsserviços} |
This file contains hidden or 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
// | |
// WatchSessionManager.swift | |
// ncast_watch Extension | |
// | |
// Created by Julio Brazil on 04/05/18. | |
// Copyright © 2018 Julio Brazil. All rights reserved. | |
// | |
import Foundation | |
import WatchConnectivity |
This file contains hidden or 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
// This is a snippet of code i ised to generate random game board on Kakuko, a game i made. | |
// the idea here is to generate a sudoku-ish matrix, where in each row or column, there is only one instance of a number from 1 to the size of the board. | |
// | |
// an example of board of size 3 would be: | |
// 3 1 2 | |
// 1 2 3 | |
// 2 3 1 | |
import Foundation |
This file contains hidden or 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
if WCSession.default.isReachable { | |
let message = ["timer": value] | |
WCSession.default.sendMessage(message, replyHandler: nil, errorHandler: nil) | |
} |
This file contains hidden or 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
func session(_ session: WCSession, didReceiveMessage message: [String : Any]) { | |
if let explode = message["explode"] as? Bool { | |
if explode { | |
startExplosionTimer() | |
} | |
} | |
} |
This file contains hidden or 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
let message = ["explode": true] | |
WCSession.default.sendMessage(message, replyHandler: nil, errorHandler: nil) |
This file contains hidden or 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
func session(_ session: WCSession, didReceiveMessage message: [String : Any]) { | |
if let timer = message["timer"] as? Int { | |
DispatchQueue.main.async { | |
self.timerLabel.setText(String(timer)) | |
if timer == 0 { | |
//EXPLOSION!! | |
} | |
} | |
} | |
} |
NewerOlder