openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
| # Open application (or file with application) | |
| alias vscode='open -a "Visual Studio Code"' | |
| # Shortcut for editing this file | |
| alias envedit='vscode /Users/goranlilja/.zshenv' | |
| # Hide/show desktop icons | |
| alias hideicons='defaults write com.apple.finder CreateDesktop false; killall Finder' | |
| alias showicons='defaults write com.apple.finder CreateDesktop true; killall Finder' | |
| # Jump directly to directories | |
| alias code='cd ~/Code' | |
| # Delete Xcode's Derived Data folder |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? | |
| func applicationWillResignActive(_ application: UIApplication) { | |
| addBlurViews() | |
| } | |
| func applicationDidBecomeActive(_ application: UIApplication) { | |
| removeBlurViews() | |
| } |
| import UIKit | |
| func create<T>(_ input: T? = nil, _ setup: ((T) -> Void)) -> T where T: NSObject { | |
| let obj = input ?? T() | |
| setup(obj) | |
| return obj | |
| } | |
| func create<T>(_ input: T? = nil, _ setup: ((T) -> Void)) -> T where T: UIView { | |
| let obj = input ?? T() |
| import UIKit | |
| import CoreLocation | |
| class ViewController: UIViewController { | |
| let locationManager = CLLocationManager() | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| locationManager.delegate = self | |
| locationManager.requestWhenInUseAuthorization() |
In order ro take a screenshot using the macOS system, you have to press a lot or keys, but you also have a few different options.
Grab.app.The quickest way of opening an app is searching for it using Spotlight.
| file="$HOME/.id" | |
| if [ ! -f $file ] | |
| then | |
| uuidgen >> $file | |
| fi | |
| cat $file |
git init
git remote add origin git@github.com:GoranLilja/ParticleNoiseFieldProcessing.git
git checkout -b master
git pull origin master
git branch --set-upstream-to=origin/master master