Skip to content

Instantly share code, notes, and snippets.

View owlwang's full-sized avatar
👨‍💻
emmmm

owlwang owlwang

👨‍💻
emmmm
View GitHub Profile
@owlwang
owlwang / decent_request.py
Created December 21, 2023 13:29 — forked from laixintao/decent_request.py
Send HTTP requests using python-requests with timeout, tcp reuse(session) and retry.
from requests.adapters import HTTPAdapter, Retry
from requests import Session
retries = Retry(
total=5, backoff_factor=1, status_forcelist=[502, 503, 504]
)
session = Session() # reuse tcp connection
session.mount("http://", HTTPAdapter(max_retries=retries))
session.mount("https://", HTTPAdapter(max_retries=retries))
@owlwang
owlwang / frida-android-tricks.js
Created June 15, 2023 11:26 — forked from zzzzfeng/frida-android-tricks.js
frida android tricks
frida -U --no-pause -l xx.js -f pkgname (or -p pid)
# PrintStack 输出当前调用堆栈
var Throwable = null;
Java.perform(function () {
Throwable = Java.use("java.lang.Throwable");
});
function PrintStack() {
var stackElements = Throwable.$new().getStackTrace();
@owlwang
owlwang / gist:52f9a931f10e46c83507164dab54581d
Created February 2, 2023 09:38 — forked from uhfx/gist:3922268
Twitter公式/非公式クライアントのコンシューマキー

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@owlwang
owlwang / pp_motion_interp.md
Created June 24, 2022 05:53 — forked from edjdavid/pp_motion_interp.md
PotPlayer Motion Interpolation
@owlwang
owlwang / weread.user.js
Created June 21, 2022 11:35 — forked from jianyun8023/weread.user.js
weread download,直接生成epub。仅用于技术研究。
// ==UserScript==
// @name 微信读书下载
// @namespace http://tampermonkey.net/
// @version 0.3
// @description 下载微信读书的书籍资源
// @author tang
// @match https://weread.qq.com/web/reader/*
// @grant unsafeWindow
// @grant GM_setValue
// @grant GM_getValue
@owlwang
owlwang / rank_metrics.py
Created January 7, 2022 03:01 — forked from bwhite/rank_metrics.py
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
import onnx
from onnx_tf.backend import prepare
import tensorflow as tf
import onnxruntime
from PIL import Image
import numpy as np
import sys
#You need to have model.onnx and neuralhash_128x96_seed1.dat in your working directory
@owlwang
owlwang / tibrr-cookie-consent.html
Created April 21, 2021 11:54 — forked from zhanglianxin/tibrr-cookie-consent.html
简化自 https://www.cloudflare.com/apps/cookie-consent ,版权归原作者所有,此例仅供学习研究使用。
@owlwang
owlwang / Caddyfile
Created February 8, 2021 15:04 — forked from phlinhng/Caddyfile
caddy 簡單反代谷歌學術
scholar.example.com {
timeouts 5m
proxy / https://scholar.google.com.hk {
except /robots.txt /usercontent
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-For {remote}
header_upstream User-Agent {>User-Agent}
# header_upstream X-Real-IP {>CF-Connecting-IP}
# header_upstream X-Forwarded-For {>CF-Connecting-IP}
header_upstream Accept-Language zh-HK
from itertools import islice
def next_n_lines(file_opened, N):
return [x.strip() for x in islice(file_opened, N)]
with open("samplefile", 'r') as f:
x = ""
while x != []: