Skip to content

Instantly share code, notes, and snippets.

View qwIvan's full-sized avatar

yang chanfa qwIvan

View GitHub Profile
// https://regex101.com/r/yX5xS8/74
const html = `
<ImG
sTyle=""
src="http://t.cn/EqRt9Eh"
class=">"
// https://regex101.com/r/yX5xS8/73
const html = `
<ImG
sTyle=""
src="http://t.cn/EqRt9Eh"
class=">"
// https://regex101.com/r/yX5xS8/73
const html = `
<ImG
sTyle=""
src="http://t.cn/EqRt9Eh"
class=">"
--- adb starting (pid 10564) ---
adb I 05-16 11:18:25 10564 10564 main.cpp:57] Android Debug Bridge version 1.0.39
adb I 05-16 11:18:25 10564 10564 main.cpp:57] Version 8.1.0_r7
adb I 05-16 11:18:25 10564 10564 main.cpp:57] Installed as /usr/bin/adb
adb I 05-16 11:18:25 10564 10564 main.cpp:57]
adb I 05-16 11:18:25 10564 10564 adb_auth_host.cpp:416] adb_auth_init...
adb I 05-16 11:18:25 10564 10564 adb_auth_host.cpp:174] read_key_file '/home/ivan/.android/adbkey'...
adb I 05-16 11:18:25 10564 10564 adb_auth_host.cpp:391] adb_auth_inotify_init...
adb I 05-16 11:18:25 10564 10564 adb_auth_host.cpp:467] Calling send_auth_response
adb I 05-16 11:35:34 10564 10564 adb_auth_host.cpp:467] Calling send_auth_response
@qwIvan
qwIvan / app.py
Created March 26, 2018 09:15 — forked from seanbehan/app.py
Flask with Django ORM
'''
Run the following commands (bc. gists don't allow directories)
pip install flask django dj-database-url psycopg2
mkdir -p app/migrations
touch app/__init__.py app/migrations/__init__.py
mv models.py app/
python manage.py makemigrations
python manage.py migrate
@qwIvan
qwIvan / app.py
Created March 26, 2018 09:15 — forked from seanbehan/app.py
Flask with Django ORM
'''
Run the following commands (bc. gists don't allow directories)
pip install flask django dj-database-url psycopg2
mkdir -p app/migrations
touch app/__init__.py app/migrations/__init__.py
mv models.py app/
python manage.py makemigrations
python manage.py migrate
@qwIvan
qwIvan / service.md
Created December 16, 2017 09:19 — forked from tniessen/service.md
Using the "service" tool with ADB and why to avoid it

As it turns out, it is not trivial to control the audio volume of an Android device using ADB. At the time of writing, the only way appears to be using the service tool. Actually, the service command allows to "connect" to a number of services (104 on Android 6.0.1) and invoke functions. Not knowing much about this tool, I managed to completely mute all sounds and speakers of my Nexus 5, and I was stuck without any sound for quite some time. I did not find a way to unmute the sound from within the system UI, so I got to dive a little deeper into this.

If you know which service you want to use, you then need to find its interface declaration. The command

service list

gives you a list of all services with the associated interfaces, if applicable:

...

26 backup: [android.app.backup.IBackupManager]

@qwIvan
qwIvan / 12306.js
Created September 13, 2017 15:06 — forked from browsnet/12306.js
12306验证码识别的demo,百度识图来判断
var http=require("http"),https=require("https"),fs=require("fs");
var exec = require('child_process').execFile;
var UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36";
//从12306获取图片
getImg().then(function(){
// 改变图片尺寸
return resizeImg();
}).then(function(){
// 把图片裁剪成8个小图片
return cropImg();
global !p
import string, vim
import textwrap
_snips_fns = {}
def py(*args):
import re
old_a = vim.eval('@a')
global !p
import string, vim
import textwrap
_snips_fns = {}
def py(*args):
import re
old_a = vim.eval('@a')