Skip to content

Instantly share code, notes, and snippets.

@lxxself
lxxself / channel_version.py
Created April 25, 2021 03:38
获取各个应用市场版本
from bs4 import BeautifulSoup as bs
import urllib3
import json
import threading
import time
def get_html(url):
http = urllib3.PoolManager()
response = http.request('GET', url, timeout=4.0)
content = response.data
@lxxself
lxxself / install_gost.sh
Last active November 28, 2020 14:28
gost
#/bin/sh
mkdir gost
cd gost
wget -O gost.gz https://github.com/ginuerzh/gost/releases/download/v2.11.1/gost-linux-amd64-2.11.1.gz
gzip gost.gz -d
chmod 777 gost
ln gost /usr/bin/gost
{
"imServer": "test01.kl9177.com",
"appServer": "test03.kl9177.com",
"imPort": 80,
"appPort": 80
}
public class HttpUtil {
private static OkHttpClient internalHttpClientWithLongTimeout;
static {
List<Protocol> list = new ArrayList<>();
list.add(Protocol.HTTP_1_1);
list.add(Protocol.HTTP_2);
internalHttpClientWithLongTimeout = new OkHttpClient.Builder()
@lxxself
lxxself / UnblockNeteaseMusic.sh
Last active February 4, 2023 05:57
UnblockNeteaseMusic termux shell
#!bin/bash
#============
# Description: UnblockNeteaseMusic termux shell
# Link: https://github.com/nondanee/UnblockNeteaseMusic
# Version: 1.0.0
# Author: lxxself
#============
echo "============update更新============"
apt update && apt -y upgrade
echo "============安装git============"
public class QuickSort{
private void quickSort(int[] array, int startIndex, int endIndex) {
if (startIndex >= endIndex) {
return;
}
int p = part(array, startIndex, endIndex);
quickSort(array, startIndex, p-1);
quickSort(array, p + 1, endIndex);
}
{"sig":"54529c5d91949ac16f4bf5b09a857fb9a50b485e4cce6222f0c88f8b27cfd0cc41c0da9dea6cfb7d3d39464235f558b17376ac08cc49a267bc4664855d7b2e1e1","msghash":"7c998b815f3a05e1262a8f3d8670e0a8ab81cb7713c5e4ab9af51da1a8f3e1f0"}
@lxxself
lxxself / CameraPermissionCompat.java
Created October 18, 2017 07:48
相机权限检测
package com.homework.app.util.camera;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.hardware.Camera;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
@lxxself
lxxself / SystemBarUtil.java
Created September 22, 2017 06:15
状态栏颜色
package com.homework.app.util;
import android.annotation.TargetApi;
import android.app.Activity;
import android.graphics.Color;
import android.os.Build;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
@lxxself
lxxself / BaseActivity.java
Created September 22, 2017 06:15
透明状态栏
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
//透明状态栏
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}