- alias openzsh="open -e /Users/dilumdesilva/.zshrc"
- alias openzsh="open -e ~/.zshrc"
- alias reloadzsh="source ~/.zshrc"
- alias open="open ."
- alias add="git add"
- alias commit="git commit"
- alias check="git checkout"
<?php | |
if(!isset($_SESSION)) { session_start(); } | |
$username = $_POST['user_name']; | |
$_SESSION['usernames'] = $username; | |
?> |
//Improved random number generator | |
source := rand.NewSource(time.Now().UnixNano()) | |
r := rand.New(source) | |
newPos := r.Intn(len(slice) - 1) | |
2019-06-03
Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.
A DMG Installer is convenient way to provide end-users a simple way to install an application bundle. They are basically a folder with a shortcut to the Applications directory but they can be customized with icons, backgrounds, and layout properties. A DMG file (.dmg) is a Mac OS X Disk Image file and it is used to package files or folders providing compression, encryption, and read-only to the package.
##Creating the DMG file #Disk Utility
extension Encodable { | |
/// converts a codable model to a dictionary | |
var dictionary: [String: Any]? { | |
guard let data = try? JSONEncoder().encode(self) else { return nil } | |
return (try? JSONSerialization.jsonObject(with: data, options: .allowFragments)).flatMap { $0 as? [String: Any] } | |
} | |
} |
import CoreMotion // Import CoreMotion (header) | |
// Class vars | |
var pitch = 0.0 | |
var attitude: CMAttitude? | |
var roll = 0.0 | |
var yaw = 0.0 | |
let motionManager = CMMotionManager() // Create motionManager instance | |
import CoreMotion // Import CoreMotion (header) | |
// Class vars | |
var pitch = 0.0 | |
var attitude: CMAttitude? | |
var roll = 0.0 | |
var yaw = 0.0 | |
let motionManager = CMMotionManager() // Create motionManager instance | |
To enable the rotation of a single view controller used to display the preview of Images/Videos. It is intuitive to allow user to rotate there device and screen changes accordingly, so it feels pleasant. But to achieve this, we need to enable the (almost) all Supported Device orientations.
Ex: `Portrait`, `LandscapeLeft`, `LandscapeRight`.