Skip to content

Instantly share code, notes, and snippets.

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?",
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
import Foundation
enum RequestDefinition {
case example(parameter: String)
var url: URL {
var urlComponents = URLComponents()
urlComponents.scheme = "https"
urlComponents.host = "example.com"
\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}
//
// WatchSessionManager.swift
// ncast_watch Extension
//
// Created by Julio Brazil on 04/05/18.
// Copyright © 2018 Julio Brazil. All rights reserved.
//
import Foundation
import WatchConnectivity
@JulioBBL
JulioBBL / puzzleGenerator.swift
Last active October 23, 2018 21:51
This is a snippet of code i used in a game i made called Kakuko.
// 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
if WCSession.default.isReachable {
let message = ["timer": value]
WCSession.default.sendMessage(message, replyHandler: nil, errorHandler: nil)
}
func session(_ session: WCSession, didReceiveMessage message: [String : Any]) {
if let explode = message["explode"] as? Bool {
if explode {
startExplosionTimer()
}
}
}
let message = ["explode": true]
WCSession.default.sendMessage(message, replyHandler: nil, errorHandler: nil)
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!!
}
}
}
}