Skip to content

Instantly share code, notes, and snippets.

View ryanking13's full-sized avatar

Gyeongjae Choi ryanking13

View GitHub Profile
from pathlib import Path
configured_path = Path(__file__).parent.parent / "cpython" / "installs" / "python-3.11.3" / "lib" / "python3.11"
archive_path = Path(__file__).parent.parent / ".." / "temp" / "cpython-3.11.3" / "Lib"
configured_lib = configured_path
archive_lib = archive_path
@ryanking13
ryanking13 / predict.py
Created April 23, 2022 01:24
KCAPTCHA prediction
import tensorflow as tf
from tensorflow.keras.preprocessing import image
from tensorflow.keras.applications import densenet
import numpy as np
def decode_prediction(predicted, char_set, length=2):
l = len(char_set)
chars = []
for i in range(length):
chars.append(char_set[np.argmax(predicted[i * l : (i + 1) * l])])
@ryanking13
ryanking13 / playwright_timeit.py
Created December 10, 2021 06:43
Performance comparison between Selenium and Playwright
#!/usr/bin/env python
# pip install selenium playwright
# playwright install
import timeit
import time
import selenium
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options as ChromeOptions
@ryanking13
ryanking13 / build.sh
Created September 6, 2021 10:09
Emscripten side_module test
emcc side.c -s SIDE_MODULE=1 -o side.wasm -s EXPORT_ALL=1
emcc main.c side.wasm -s MAIN_MODULE=1 -s EXPORT_ALL=1 -o main.js
# node main.js
import numpy as np
import matplotlib.pyplot as plt
def simulate(speed_1, load_ratio=0.4, num_attack_1=5, cooltime_2=1 / 6):
cooltime_1 = 1.0 / speed_1
load_time = cooltime_1 * load_ratio
attack_time = cooltime_1 - load_time
sub_attack_period = attack_time / num_attack_1
@ryanking13
ryanking13 / skip.js
Last active September 10, 2020 07:42
hunet_skip
// ([행복한 동행] 4대 폭력 예방) 학습하기 --> F12 --> Console --> 아래 코드 복붙 /
// ([건강한 조직 만들기] 아동학대 예방교육)는 형식이 달라서 안 됨
var form = h_frame.document.form1;
var s = form.action;
var s2 = s.replace(/current_frame_count=([0-9]+)/, "current_frame_count=10");
form.action = s2;
form.submit();
@ryanking13
ryanking13 / setup
Created December 3, 2019 05:50
AIX setup
mkuser home=/home/testuser testuser
passwd testuser
chfs -a size=3G /home
chfs -a size=3G /opt
@ryanking13
ryanking13 / README.md
Created September 12, 2019 15:12
pypi upload
python setup.py sdist
twine upload dist/*
@ryanking13
ryanking13 / README.md
Last active August 12, 2019 08:00
Windows git credential reset
remote: Permission to <your_repo> denied to <other_user>.

다른 개발자 github credential을 등록해둔 것 때문에 github push시에 permission denied 에러가 발생할 때,

git credential-manager clear
 Target Url:
https://github.com
@ryanking13
ryanking13 / queries.txt
Created March 27, 2019 15:22
sql test queries
create table tbl (a int);
create table tbl (b char(5));
create table tbl (c date);
create table tbl (a int, b char(2), c date);
create table tbl (a int not null);
create table account (
account_number int not null,
branch_name char(15),
primary key(account_number)
);