Skip to content

Instantly share code, notes, and snippets.

Avatar

Joker pcqpcq

View GitHub Profile
@pcqpcq
pcqpcq / .bash_profile
Created May 11, 2020
or .zsh_profile for macos 10.15+
View .bash_profile
export http_proxy="127.0.0.1:8001"
export https_proxy="127.0.0.1:8001"
export ALL_PROXY="127.0.0.1:8001"
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export ANDROID_SDK=/Users/pcqpcq/Documents/android_sdk
export FLUTTER_SDK=/Users/pcqpcq/Documents/flutter_sdk
@pcqpcq
pcqpcq / pings.bat
Last active Oct 11, 2019
shell script for ping multiple dns
View pings.bat
@echo off
set PING_COUNT=10
set SKIP_LINE=13
set DNS_ADDRESS_ARRAY=168.126.63.1 ^
168.126.63.2 ^
223.5.5.5 ^
223.6.6.6 ^
168.95.1.1 ^
168.95.192.1 ^
@pcqpcq
pcqpcq / try_package.sh
Last active Mar 11, 2019
package loop demo
View try_package.sh
#!/bin/bash
# right_file_size = 47899100
FILE_SIZE_AT_LEAST=47800000
FINISH_SIGNAL=0
TARGET_FILE=/Users/pcqpcq/Documents/android_publish_packages/bbtime/app/build/outputs/apk/official/release/bbtime_base_1.9.4_20190311.apk
while [[ "$FINISH_SIGNAL" -ne 1 ]]
do
@pcqpcq
pcqpcq / rename.sh
Created Feb 19, 2019
demo shell script. 重命名当前目录下所有数字视频文件名
View rename.sh
#!/bin/bash
for file in ./*
do
fname=$(basename $file .mp4) #获取文件名
expr $fname "+" 10 &> /dev/null # 判断是否数字
if [ $? -eq 0 ];then # 判断是否数字
name=$(($fname+98)) # 数字运算
echo "$name is number" # log
mv $fname.mp4 $name.mp4 # 重命名
fi
@pcqpcq
pcqpcq / karabiner.json
Created Jul 19, 2018
Karabiner-Element config file for laptop keyboard with NumLock on. Put it at ~/.config/karabiner/karabiner.json
View karabiner.json
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
View calendar.widget.coffee
sundayFirstCalendar = 'cal && date'
mondayFirstCalendar = 'cal | awk \'{ print " "$0; getline; print "Mo Tu We Th Fr Sa Su"; \
getline; if (substr($0,1,2) == " 1") print " 1 "; \
do { prevline=$0; if (getline == 0) exit; print " " \
substr(prevline,4,17) " " substr($0,1,2) " "; } while (1) }\' && date'
command: sundayFirstCalendar
refreshFrequency: 3600000
@pcqpcq
pcqpcq / PossibleAndroidId.java
Last active May 25, 2017
any possible ways to get an android id outside the world.
View PossibleAndroidId.java
// #region from [here](https://github.com/nisrulz/easydeviceinfo/blob/develop/easydeviceinfo-base/src/main/java/github/nisrulz/easydeviceinfo/base/EasyIdMod.java)
/**
* Gets android id.
*
* @return the android id
*/
@SuppressLint("HardwareIds")
public final String getAndroidID() {
return CheckValidityUtil.checkValidData(
Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID));
@pcqpcq
pcqpcq / shadow.xml
Created Aug 23, 2016 — forked from lecho/shadow.xml
Android shadow drawable xml.
View shadow.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- Drop Shadow Stack -->
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
@pcqpcq
pcqpcq / default.custom.yaml
Created May 5, 2016 — forked from lotem/default.custom.yaml
在Rime輸入方案選單中添加五筆、雙拼、粵拼、注音,保留你需要的
View default.custom.yaml
# default.custom.yaml
# save it to:
# ~/.config/ibus/rime (linux)
# ~/Library/Rime (macos)
# %APPDATA%\Rime (windows)
patch:
schema_list:
- schema: luna_pinyin # 朙月拼音
- schema: luna_pinyin_simp # 朙月拼音 简化字模式
View HybridTimer.java
package com.oasisfeng.greenify.utils;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Handler;
import android.os.Looper;