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
## Secure Boot | |
Security > Secure Boot: | |
- Secure Boot Mode [Standard] > Install factory defaults [Yes] > Reset Without Saving? [No] | |
- Secure Boot [Enabled] | |
## Always On | |
Advanced > AMD CBS > FCH Common Options > Ac Power Loss Options: | |
- Ac Loss Control [Always On] |
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
# Check Existing SWAP | |
swapon --show | |
# Set Up SWAP | |
fallocate -l 2G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
# Make SWAP Persistant Across Reboots |
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 SwiftUI | |
import PlaygroundSupport | |
struct ContentView: View { | |
var body: some View { | |
Text("Hello World") | |
} | |
} | |
let host = UIHostingController(rootView: ContentView()) |
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
// | |
// RestAPI.swift | |
// RestAPI | |
// | |
// Created by Rodrigo Dumont on 25/04/18. | |
// | |
open class RestAPI<T: Codable> { | |
public typealias Then = (T?, Error?) -> () |
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 | |
enum Theme { | |
case light | |
case dark | |
} | |
extension Theme { | |
var defaultTextColor: UIColor { | |
switch self { |
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 a file: | |
$ pico /Users/Shared/logoutHook.sh | |
File content: | |
#!/bin/bash | |
say 'Hasta la vista baby!' | |
Set exuction permission: | |
$ sudo chmod +x /Users/Shared/logoutHook.sh |
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
// MARK: - String mask | |
class Mask { | |
class func maskCep(CepString: String?) -> String { | |
guard let CepString = CepString else { | |
return "" | |
} | |
var text = CepString.replacingOccurrences(of: "-", with: "") | |
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
// | |
// BaseRepository.swift | |
// | |
// Created by Rodrigo Dumont on 7/4/16. | |
// Copyright © 2016 Rodrigo Dumont. All rights reserved. | |
// | |
import Alamofire | |
import SwiftyJSON |
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
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(keyboardWillShow), name:UIKeyboardWillShowNotification, object: nil) | |
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(keyboardWillHide), name:UIKeyboardWillHideNotification, object: nil) | |
func keyboardWillShow(notification:NSNotification){ | |
var userInfo = notification.userInfo! | |
var keyboardFrame:CGRect = (userInfo[UIKeyboardFrameBeginUserInfoKey] as! NSValue).CGRectValue() | |
keyboardFrame = self.view.convertRect(keyboardFrame, fromView: nil) | |
var contentInset:UIEdgeInsets = self.scrollView.contentInset |
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
Codes | |
*#*#4636#*#* — Exibe informações do telefone, bateria e estatísticas de uso; | |
*#*#7780#*#* — Restaura o aparelho para os padrões de fábrica, apagando aplicativos e dados; | |
*2767*3855# — Reinstala o firmware do dispositivo; | |
*#*#34971539#*#* — Apresenta informações detalhadas da câmera; | |
*#*#7594#*#* — Altera o comportamento do botão liga/desliga, permitindo que o eletrônico seja desligando com um único pressionamento; | |
*#*#273283*255*663282*#*#* — Realiza um backup rápido de todos os arquivos de mídia; | |
*#*#197328640#*#* — Habilita o modo de teste; | |
*#*#232339#*#* ou *#*#526#*#* — Executa um teste da conectividade sem fio LAN |