Skip to content

Instantly share code, notes, and snippets.

Ivan Ng qwIvan

  • 广州
Block or report user

Report or block qwIvan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View adb.1000.log
--- 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 Mar 26, 2018 — forked from seanbehan/app.py
Flask with Django ORM
View app.py
'''
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 Mar 26, 2018 — forked from seanbehan/app.py
Flask with Django ORM
View app.py
'''
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 Dec 16, 2017 — forked from tniessen/service.md
Using the "service" tool with ADB and why to avoid it
View service.md

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 Sep 13, 2017 — forked from browsnet/12306.js
12306验证码识别的demo,百度识图来判断
View 12306.js
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();
View ultisnips_py_console
global !p
import string, vim
import textwrap
_snips_fns = {}
def py(*args):
import re
old_a = vim.eval('@a')
View ultisnips_py_console
global !p
import string, vim
import textwrap
_snips_fns = {}
def py(*args):
import re
old_a = vim.eval('@a')
You can’t perform that action at this time.