Skip to content

Instantly share code, notes, and snippets.

@siamkreative
siamkreative / disable-bloatware-xiaomi-phones.md
Last active February 18, 2024 11:07
Disabling bloatware on Xiaomi phones

How to disable or uninstall bloatwares on Xiaomi?

This guide is for non-rooted Xiaomi/Redmi/POCO phones.

  1. You will first need to install Android Debug Bridge (ADB): https://developer.android.com/tools/adb. On a Mac, you can install it with Brew: brew install android-platform-tools
  2. To use adb with a device connected over USB, you must enable USB debugging in the device system settings, under Developer options. On a Xiaomi phone, tap the MIUI version multiple times until Developer Options are unlocked. You can then search the Settings for "USB debugging" and enable it.
  3. Connect the phone to your computer via USB. Choose “File Transfer” mode.
  4. Open a terminal and run adb devices
  5. Your phone will prompt to add your computer’s key to allowed, whihc you must agree to.
  6. On the terminal, enter adb shell.
@noraj
noraj / gulp-cjs-to-esm.md
Last active May 6, 2024 09:01
Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Context

del v7.0.0 moved to pure ESM (no dual support), which forced me to move my gulpfile to ESM to be able to continue to use del.

The author sindresorhus maintains a lot of npm packages and does not want to provides an upgrade guide for each package so he provided a generic guide. But this guide is a bit vague because it's generic and not helping for gulp, hence this guide.

Guide

// ==UserScript==
// @name Convert post to Gutenberg
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Convert Wordpress classic posts to Gutenberg layout
// @author Micah Engle-Eshleman
// @include /^https:\/\/subdomain\.domain\.com\/wp-admin\/post.php\?post=\d+&action=edit/
// @grant none
// ==/UserScript==
@thatdevgirl
thatdevgirl / simple-autocomplete.js
Created November 29, 2018 15:29
Simple Autocomplete component for WP Gutenberg
/**
* A very simple autocomplete component
*
* This is to replace the OOTB Gutenberg Autocomplete component because it is
* currently broken as of v4.5.1.
*
* See Github issue: https://github.com/WordPress/gutenberg/issues/10542
*
* Note: The options array should be an array of objects containing labels and values; i.e.:
* [
@bittner
bittner / 60-jetbrains.conf
Created September 25, 2015 07:57
Inotify configuration for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm). Create this file with e.g. `sudo vim /etc/sysctl.d/60-jetbrains.conf`
# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
# Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu), and
# run `sudo service procps start` or reboot.
# Source: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
#
# More information resources:
# -$ man inotify # manpage
# -$ man sysctl.conf # manpage
# -$ cat /proc/sys/fs/inotify/max_user_watches # print current value in use