Skip to content

Instantly share code, notes, and snippets.

View wasdee's full-sized avatar
🏠
Working from home

Nutchanon Ninyawee wasdee

🏠
Working from home
View GitHub Profile
@wasdee
wasdee / handsomeBoundingBox.py
Last active September 8, 2018 22:15
[circular retangular] movie-like bounding box for face detection #opencv #boundingbox
# Fancy box drawing function by Dan Masek
def draw_border(img, pt1, pt2, color, thickness, r, d):
x1, y1 = pt1
x2, y2 = pt2
# Top left drawing
cv2.line(img, (x1 + r, y1), (x1 + r + d, y1), color, thickness)
cv2.line(img, (x1, y1 + r), (x1, y1 + r + d), color, thickness)
cv2.ellipse(img, (x1 + r, y1 + r), (r, r), 180, 0, 90, color, thickness)
# constract energy grid
E = np.zeros(image.shape + (2,))
for index in np.ndindex(F_t.shape):
y,x,c = index
smooth_constraint = 0
try:
smooth_constraint += ( (F_t[y,x+1,c] - F_t[y,x,c]) )**2
except IndexError:
@wasdee
wasdee / nvvp.md
Last active September 8, 2018 22:17 — forked from sonots/nvvp.md
How to use NVIDIA profiler #cuda

Usually, located at /usr/local/cuda/bin

Non-Visual Profiler

$ nvprof python train_mnist.py

I prefer to use --print-gpu-trace.

@wasdee
wasdee / .leptonrc
Last active September 8, 2018 22:51 — forked from hackjutsu/.leptonrc
[Template for .leptonrc] This is a template for Lepton's configuration file. Please place it on your home directory. #lepton
{
"snippet": {
"expanded": true,
"newSnippetPrivate": false,
"sorting": "updated_at",
"sortingReverse": true
},
"editor" : {
"tabSize": 4
@wasdee
wasdee / readme.md
Created September 8, 2018 23:10
[PUBG Mobile get friend status]APK Decoding: Smali #reverseengineer #pubgmobile

Notes

APK Decoding: Smali

Clues

Friends info variable

smali/com/tencent/imsdk/android/api/common/IMSDKFriendInfo.smali

containing

  • channel_id
  • user_id
@wasdee
wasdee / readme.md
Last active September 8, 2018 23:46
[Pubg Mobile webdebug proxy report] #pubgmobile #reverseengineer

Notes

How I do it?

  1. having iPhone and macOS in the same local network
  2. use charles proxy to intercept the communication

Alternatively, you can try jame or mitm proxy instead

Result

@wasdee
wasdee / readme.md
Created September 9, 2018 06:09
[scrapy shell] header and token #scrapy
@wasdee
wasdee / readme.md
Last active October 10, 2018 15:26
[My Python Awesome] #python #awesome

library

subprocess-like

sultan wanna sudo things

delegator.py simple aproach https://github.com/kennethreitz/delegator.py

Daily life

autosub wanna translate videos by subtitle-it JAV, Learning Youtube Especially in Chinese, use pip from git

@wasdee
wasdee / control local chrome.md
Last active September 10, 2018 08:54
[pyppeteer experiences] #python #pyppeteer

control local chrome

If you want to use existing cookies, you will be regret of reading because I cannot successfully control it.

normally, pyppeteer will use chromium. but we could alter to our chrome.

How I have done

Require info

  1. go to chrome:version on chrome
  2. seek for excutatble path
@wasdee
wasdee / readme.md
Last active September 10, 2018 18:32
[python re in nutshell] #python

re - regex

method

func parameter re.func(pat, str2match, flags)

  • re.findall, re.iterall = list vs generator
  • re.match - match from start of string
  • re.search - match anywhere
  • re.sub
  • re.split