Skip to content

Instantly share code, notes, and snippets.

@ThrowJojo
ThrowJojo / copy_config.sh
Created August 18, 2017 00:51
Copy wp-config-sample.php file
cp wp-config-sample.php wp-config.php
@ThrowJojo
ThrowJojo / wp-config.php
Created August 18, 2017 00:53
Start of wp-config.php file
*
* @link https://codex.wordpress.org/Editing_wp-config.php
*
* @package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');
@ThrowJojo
ThrowJojo / Notifications.kt
Created August 28, 2017 00:07
Show System Notification Settings in Android
val intent = Intent()
intent.action = "android.settings.APP_NOTIFICATION_SETTINGS"
intent.putExtra("android.provider.extra.APP_PACKAGE", "android")
startActivity(intent)
@ThrowJojo
ThrowJojo / SystemNotifications.java
Created September 4, 2017 05:16
Opens the System Notification settings for Android
Intent intent = new Intent("android.settings.APP_NOTIFICATION_SETTINGS");
intent.putExtra("android.provider.extra.APP_PACKAGE", "android");
startActivity(intent);
@ThrowJojo
ThrowJojo / StopLockTask.kt
Created September 11, 2017 03:56
Stops a lock task.
stopLockTask()
@ThrowJojo
ThrowJojo / StartLockTask.kt
Created September 11, 2017 03:57
Starts a lock task.
startLockTask()
@ThrowJojo
ThrowJojo / LockTaskModeActive.kt
Created September 11, 2017 03:58
Checks if a lock task(screen pinning) is active or not.
// Checks if lock task mode is active or not
private fun lockTaskModeActive(): Boolean {
val activityManager = getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
return activityManager.lockTaskModeState != ActivityManager.LOCK_TASK_MODE_NONE
} else {
return activityManager.isInLockTaskMode
}
}
@ThrowJojo
ThrowJojo / Uninstall.java
Created September 12, 2017 23:57
Intent for an uninstall dialogue.
public void uninstallApp(String packageName) {
Intent intent = new Intent(Intent.ACTION_DELETE);
intent.setData(Uri.parse("package:" + packageName));
startActivity(intent);
}
@ThrowJojo
ThrowJojo / Uninstall.java
Created September 12, 2017 23:57
Intent for an uninstall dialogue.
public void uninstallApp(String packageName) {
Intent intent = new Intent(Intent.ACTION_DELETE);
intent.setData(Uri.parse("package:" + packageName));
startActivity(intent);
}
@ThrowJojo
ThrowJojo / mobx.sh
Created September 19, 2017 03:50
Install MobX packages.
npm install --save mobx mobx-react