Skip to content

Instantly share code, notes, and snippets.

@hutusi
hutusi / git paging.md
Last active January 1, 2024 15:56
Git checkout next / prev commit

Treat git log as a book, exec git next or git prev to checkout the next or the previous commit.

Please check hutusi/git-paging for updates.

@AO8
AO8 / table_writer.py
Last active October 3, 2022 09:28
Convert an HTML table into a CSV file with Python and BeautifulSoup.
# Adapted from example in "Web Scraping with Python, 2nd Edition" by Ran Mitchell.
import csv
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen("http://en.wikipedia.org/wiki/"
"Comparison_of_text_editors")
soup = BeautifulSoup(html, "html.parser")
table = soup.findAll("table", {"class":"wikitable"})[0]
@RussellCollins
RussellCollins / APK_download_deploy.sh
Created April 16, 2017 04:18
A convenience script for automatically pulling Android builds from a static URL and distributing them to connected devices. Assumes AAPT and adb are in your PATH variable already.
#!/bin/sh
APK_URL="" ###### UPDATE THIS WITH THE URL TO THE ARCHIVED LAST SUCCESSFUL BUILD ARTIFACT ON JENKINS FOR EXAMPLE
FILEPATH=""
## MAKE SURE ADB IS RUNNING ##
adb version
@mugifly
mugifly / adb-android-disable-animation.sh
Last active December 8, 2022 22:40
Disable the animation of Android Virtual Device using adb command
# For Android JellyBean and newer device
adb shell content update --uri content://settings/system --bind value:s:0.0 --where 'name="window_animation_scale"'
adb shell content update --uri content://settings/system --bind value:s:0.0 --where 'name="transition_animation_scale"'
adb shell content update --uri content://settings/system --bind value:s:0.0 --where 'name="animator_duration_scale"'
# For Android ICS and older device
adb shell "echo \"update system set value=0.0 where name='window_animation_scale';\" | sqlite3 /data/data/com.android.providers.settings/databases/settings.db"
adb shell "echo \"update system set value=0.0 where name='transition_animation_scale';\" | sqlite3 /data/data/com.android.providers.settings/databases/settings.db"
@j796160836
j796160836 / InspectAPK.sh
Last active February 22, 2022 16:46
Inspect APK's info like package name, version code, version name, etcetera
#!/bin/bash
apk_file=$1
if [ -z $apk_file ]; then
apk_file_num=`ls *.apk | wc -l | tr -d ' '`
if [ $apk_file_num -gt 1 ]; then
echo "Ambiguous apk_files. Please enter one APK to inspect."
exit -1
fi
apk_file=`ls *.apk`
@109021017
109021017 / current_activity.sh
Created February 3, 2016 09:32
A shell script log the current android top activity
oldActvity=""
displayName=""
currentActivity=`adb shell dumpsys window windows | grep -E 'mCurrentFocus'`
while true
do
if [[ $oldActvity != $currentActivity && $currentActivity != *"=null"* ]]; then
displayName=${currentActivity##* }
displayName=${displayName%%\}*}
echo $displayName
oldActvity=$currentActivity
@race604
race604 / adb+
Last active August 20, 2023 09:03
#!/bin/bash
# Script adb+
# Run any command adb provides on all your currently connected devices,
# Or prompt to select one device
showHelp() {
echo "Usage: adb+ [-a] <command>"
echo " -h: show help"
echo " -a: run command on all device"
echo " command: normal adb commands"
@abrasumente233
abrasumente233 / nesign.py
Last active June 26, 2022 01:46
网易云音乐签到(pc android)
# -*- coding: utf-8 -*-
"""网易云自动签到"""
import requests
__author__ = 'abrasumente'
@ladder1984
ladder1984 / login_jingdong.py
Last active November 29, 2018 02:35
自动登录京东网,基于requests、pyquery。
# -*- coding: utf-8 -*-
import requests
from pyquery import PyQuery as pq
login_url = "https://passport.jd.com/new/login.aspx"
login_post_url = "http://passport.jd.com/uc/loginService"
# 用户名和密码
username = "your_name"
password = "your_password"
@gabrielemariotti
gabrielemariotti / README.md
Last active February 24, 2021 10:52
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

root
  --gradleScript
 ----dependencies.gradle