This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.util.Log; | |
import androidx.core.widget.NestedScrollView; | |
import androidx.recyclerview.widget.RecyclerView; | |
public abstract class EndlessNestedScrollViewListener implements NestedScrollView.OnScrollChangeListener { | |
private boolean loading = true; | |
private int pageNumber = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.util.Log; | |
import android.widget.Toast; | |
import androidx.recyclerview.widget.GridLayoutManager; | |
import androidx.recyclerview.widget.LinearLayoutManager; | |
import androidx.recyclerview.widget.RecyclerView; | |
import androidx.recyclerview.widget.StaggeredGridLayoutManager; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.graphics.Color; | |
import androidx.annotation.NonNull; | |
import androidx.fragment.app.FragmentActivity; | |
import androidx.recyclerview.widget.RecyclerView; | |
import android.text.TextUtils; | |
import android.view.LayoutInflater; | |
import android.view.View; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.app.ActivityManager; | |
import android.content.Context; | |
import android.content.pm.ActivityInfo; | |
import android.os.Bundle; | |
import android.os.CountDownTimer; | |
import android.util.Log; | |
import android.view.KeyEvent; | |
import android.view.View; | |
import android.webkit.WebResourceRequest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressLint("InlinedApi") | |
private fun hideSystemUi() { | |
WindowCompat.setDecorFitsSystemWindows(window, false) | |
WindowInsetsControllerCompat(window, viewBinding.videoView).let { controller -> | |
controller.hide(WindowInsetsCompat.Type.systemBars()) | |
controller.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// copy disk image of android device | |
// example adb command : adb shell su -c "dd if=/dev/block/bootdevice/by-name/system of=/sdcard/system.img" | |
// In this example, replace /dev/block/bootdevice/by-name/system with the specific partition or block you want to image, | |
// and /sdcard/system.img with the desired output file | |
// example adb command: adb pull /dev/block/mmcblk0 mmcblk0.img | |
String[] arrayCommand = {"sh", "-c","dumpsys telephony.registry | grep \"permission\""}; | |
// in kotllin | |
val arrayCommand = arrayOf("su", "-c", "dumpsys", "telephony.registry", "|", "grep", "\"mCi=\"") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//JAVA 17+ | |
//KOTLIN 1.7.20 | |
//DEPS org.apache.commons:commons-text:1.9 | |
//DEPS org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.async | |
import kotlinx.coroutines.runBlocking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install python-telegram-bot | |
from telegram.ext import Updater, MessageHandler, Filters | |
from telegram import ParseMode | |
import logging | |
# Set your Telegram bot token | |
TOKEN = 'your_bot_token' | |
# Set the user ID you want to monitor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install PyPDF2 | |
## version 2 | |
import PyPDF2 | |
def add_newline_on_semicolon(pdf_path): | |
# Open the PDF file in binary mode | |
with open(pdf_path, 'rb') as pdf_file: | |
# Create a PDF reader object | |
pdf_reader = PyPDF2.PdfFileReader(pdf_file) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open the CSV file using csv lib | |
import csv | |
file = open('Salary_Data.csv') | |
csvreader = csv.reader(file) | |
header = [] | |
header = next(csvreader) | |
header ## print header | |
rows = [] | |
for row in csvreader: | |
rows.append(row) |
OlderNewer