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 |
NewerOlder