XAMPP + xDebug + PhpStorm (notes + snippets) for MAC (2021, December)
NOTE: XAMPP is going to use PHP version 8 in this "tutorial". Install xampp. If you don't have brew then you will have to install it. brew install xampp Go…
NOTE: XAMPP is going to use PHP version 8 in this "tutorial". Install xampp. If you don't have brew then you will have to install it. brew install xampp Go…
In short, here is the snippet converting parameter from POST/GET to boolean: if (isset($_GET['debug'])) { $DEBUG = filter_var($_GET['debug'], FILTER_VALIDATE_BOOLEAN); }
Here is a small snippet to use if you want to force screen to be displayed in landscape mode. Place it before onCreate call. .line 9 const/4 v0, 0x0 invoke-virtual…
Sample 1: How to properly make junit tests for that so you will make sure that ValidateStatus.Invalid will be called if EditText child text is empty? class ViewGroupKeyValidator(private val sequence:…
Validating the password: private fun validatePassword(password: String, passwordConfirmation: String): Boolean { val specialCharPattern = Pattern.compile("[^a-z0-9]", Pattern.CASE_INSENSITIVE) val upperCasePatten = Pattern.compile("[A-Z]") val lowerCasePatten = Pattern.compile("[a-z]") val digitCasePatten = Pattern.compile("[0-9]") if (TextUtils.isEmpty(password)…
Here is simple snippet for making imitation of underline for textview. To use it - just set it as a textview's background. <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:background="#EDF5F5"> <item…
To make it possible you have to first kill the running instance of VNC server and then start it again with additional argument. Here are the commands: 1. vncserver -list…
Here is the snippet for sending intent to open deeplink: adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d '{your_protocol}://{your_path_pattern}' Sample: adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d…
There are few steps to do: Install plugin it by call (https://github.com/Urucas/QLGradle): brew cask install qlgradle 2. In terminal reload qlmanager (https://stackoverflow.com/a/62650032/619673): qlmanage -r 3. Reload finder (https://9to5mac.com/2019/01/18/restart-finder-mac/): Apple logo…
Get device's dimension: adb shell wm size > Physical size: 2880x1600 Get device's density: adb shell wm density > Physical density: 320 Hide status bar and navigation bar: adb shell…