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
@discardableResult | |
@inlinable | |
private func with<T>(_ value: T, _ builder: (T) throws -> Void) rethrows -> T { | |
try builder(value) | |
return value | |
} | |
// Use | |
class MyClass { | |
var prop = "it's" |
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
/** | |
* ESP8266 Scanner - Scans for networks on the 2.4GHz band and prints them out to the console. | |
* Program it onto your ESP8266, pull up miniterm, the Serial Monitor, etc, and view a list of | |
* wireless networks on your computer. | |
* Requres Arduino JSON (http://arduinojson.org/), downloadable from Library Manager or GitHub. | |
* Or, set OUTPUT_JSON and consume the serial output with your favorite JSON parser. | |
* | |
* Created by Leonora Tindall in 2017 for the ESP8266. | |
* This software is licensed under the GNU General Public License, Version 3.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
// | |
// Obfuscator.swift | |
// | |
// Created by Dejan Atanasov on 2017-05-31. | |
// | |
import Foundation | |
class Obfuscator: AnyObject { | |
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 UIKit | |
import XCPlayground | |
import CoreGraphics | |
import PlaygroundSupport | |
/* | |
* Demo | |
*/ | |
func applyPerspective(_ view: UIView, distance: CGFloat) { | |
view.layer.transform.m34 = 1.0 / distance |
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
// Swift4 | |
let image = UIImage(named: "sample") | |
let data = image?.pngData() | |
let data = image?.jpegData(compressionQuality: 0.9) | |
let uiImage: UIImage = UIImage(data: imageData) | |
// deprecated | |
// var imageData: Data = UIImagePNGRepresentation(image) |
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
A publicação de conteúdo em redes sociais não é uma construção de um CV público. | |
Assim como a contribuição com projetos open source não se caracteriza, por si só, como um portfólio de venda. | |
Não é porque postei receitas e fiz checkin em restaurantes que tenho pretensão em ser crítico da Michelin. | |
Vocês indexam e expõe devs como se os mesmos estivessem aptos a serem bombardeados com spam de empresas e propostas de freelas ou projetos irrelevantes para o profissional. | |
Inclusive, listando tecnologias que a pessoa não domina, gerando uma propaganda falsa. | |
Foram além e infringiram regras do GitHub para coleção de dados: | |
https://twitter.com/ezefranca/status/808344095919894529 |
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
// Create the Activity Indicator | |
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray) | |
// Add it to the view where you want it to appear | |
view.addSubview(activityIndicator) | |
// Set up its size (the super view bounds usually) | |
activityIndicator.frame = view.bounds | |
// Start the loading animation | |
activityIndicator.startAnimating() |
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 UIKit | |
protocol DismissalDelegate : class { | |
func finishedShowing(viewController: UIViewController) | |
} | |
protocol Dismissible : class { | |
weak var dismissalDelegate : DismissalDelegate? { get set } | |
} |
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
# The trick is to link the DeviceSupport folder from the beta to the stable version. | |
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
# (A similar approach works for older versions too, just change the version number after DeviceSupport) |
NewerOlder