Skip to content

Instantly share code, notes, and snippets.

View tsabian's full-sized avatar
🏡
I may be slow to respond.

Tiago Oliveira tsabian

🏡
I may be slow to respond.
View GitHub Profile
#!/bin/bash
# Variáveis do projeto
PROJECT_NAME="{projeto_name}"
SCHEME_NAME="MyAppDistribution"
TEST_SCHEME_NAME="MyAppDistributionSimulator"
CONFIGURATION="Debug"
OUTPUT_DIR="./Bin"
ENV_TARGET="PRE_PRODUCTION"
#!/bin/bash
APP_ID=0000000001
GOOGLE_PLIST="GoogleService-Info-HML.plist"
DSYMS_FILE_NAME=appDsyms.zip
TARGET_DIRECTORY=./symbols
if [ -d ${TARGET_DIRECTORY} ]; then
rm -rf ${TARGET_DIRECTORY}
fi
import Foundation
import CryptoKit
private func MD5(string: String) -> String {
return Insecure
.MD5
.hash(data: string.data(using: .utf8) ?? Data())
.map { String(format: "%02hhx", $0) }
.joined()
}
public extension Date {
func microsecondsDate() -> String {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss.'MICROS'xx"
formatter.locale = Locale(identifier: "en_US_POSIX")
let dateComponent = Calendar.current.dateComponents([.nanosecond], from: self)
let microseconds = Int(Double(dateComponent.nanosecond! / 1000).rounded(.toNearestOrEven))
let secondsPart = String(microseconds).padding(toLength: 6, withPad: "0", startingAt: 0)
let timeStamp = formatter.string(from: self)
@tsabian
tsabian / Receita de panqueca.md
Last active March 18, 2025 17:01
Panqueca Delícia !!! 🤤

Panquecas

Ingredientes para duas vezes a receita (para 4 pessoas):

  • 2 xícaras de farinha de trigo
  • 4 colheres de sopa de açúcar
  • 2 colheres de chá de fermento em pó
  • 1 colher de chá de bicarbonato de sódio
  • 1/2 colher de chá de sal
  • 2 xícaras de leite
/*
O método grava uma entrada não validada no JSON. Essa chamada pode permitir que um invasor injete elementos ou atributos
arbitrários na entidade JSON.
*/
// MARK: - Application
import Foundation
import UIKit

Pesquisa de arquivo pelo terminal

find <root_directory> -name '<file_matching_pattern>'
find <root_directory> -name '<file_matching_pattern>' -exec cat {} \; -exec grep --colour -i 'text_matching_pattern' {} \;
import UIKit
guard let directory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else {
fatalError("The document directory does not exist")
}
var filePath: URL!
var list = [[String: Any]]()
let element: [String: Any] = ["kTokenRef": 1, "kTokenUseKeychain": true]
list.append(element)
import UIKit
let text = "texto para ser escrito em um arquivo"
let fileManager = FileManager.default
guard let directory = fileManager.urls(for: .documentDirectory, in: .userDomainMask).first else {
fatalError("The Current directory does not exist")
}
let filePath = directory.appending(path: "arquivo.txt")
import SystemConfiguration
public class Reachabilty {
class func HasConnection() -> Bool {
var zeroAddress = sockaddr_in(sin_len: 0, sin_family: 0, sin_port: 0, sin_addr: in_addr(s_addr: 0), sin_zero: (0, 0, 0, 0, 0, 0, 0, 0))
zeroAddress.sin_len = UInt8(MemoryLayout.size(ofValue: zeroAddress))
zeroAddress.sin_family = sa_family_t(AF_INET)