Skip to content

Instantly share code, notes, and snippets.

View androidneha's full-sized avatar
😒
Maintaining Distance

Neha Sharma androidneha

😒
Maintaining Distance
  • New Delhi, India
View GitHub Profile
List<String> fetchItemToDisplay(List<List<String>> items, int sortParameter, int sortOrder, int itemsPerPage, int pageNumber) {
List<String> output = new ArrayList<>();
Collections.sort(items, (a, b) -> {
if (sortOrder == 0) {
return sortParameter != 0 ?
Integer.parseInt(a.get(sortParameter)) - Integer.parseInt(b.get(sortParameter)) :
a.get(sortParameter).compareTo(b.get(sortParameter));
} else {
return sortParameter != 0 ?
Integer.parseInt(b.get(sortParameter)) - Integer.parseInt(a.get(sortParameter)) :
#!/usr/bin/env bash
echo "
----------------------
NODE & NPM
----------------------
"
# add nodejs 18 ppa (personal package archive) from nodesource
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
@androidneha
androidneha / adb_commands.MD
Last active November 7, 2024 12:58
Some adb commands to change setting for battery optimisation, start service, stop service, grant permission, revoke permission and etc.

To list-up installed app

pm list packages

Search for a particualr app with pacakagename

pm list pacakges | grep com.abc

Turn on Battery Optimization for a particular app

adb shell dumpsys deviceidle whitelist -<package_name>

Turn off Battery Optimization for a particular app