Skip to content

Instantly share code, notes, and snippets.

View CWKSC's full-sized avatar
🏫
in school

CWKSC CWKSC

🏫
in school
View GitHub Profile
@CWKSC
CWKSC / build_venv.ps1
Created April 1, 2022 19:07
build python venv
python -m venv venv
.\venv\Scripts\activate
python -m pip install --upgrade pip
pause
deactivate
@CWKSC
CWKSC / .gitignore
Last active February 24, 2022 09:55
My .gitignore for Intellij IDEA with gradle and Kotlin
*.zip
*.tar.gz
.DS_Store
build/
out/
.gradle/7.1/executionHistory/executionHistory.bin
.gradle/7.1/executionHistory/executionHistory.lock
.gradle/7.1/fileHashes/fileHashes.bin
.gradle/7.1/fileHashes/fileHashes.lock
.gradle/7.1/fileHashes/resourceHashesCache.bin
@CWKSC
CWKSC / settings.py
Last active January 18, 2022 17:34
Django with postgres note
import os
DATABASES = {
'default': {
'ENGINE': os.environ.get('DATABASE_ENGINE'),
'NAME': os.environ.get('DATABASE_NAME'),
'USER': os.environ.get('DATABASE_USER'),
'PASSWORD': os.environ.get('DATABASE_PASSWORD'),
'HOST': os.environ.get('DATABASE_HOST'),
'PORT': os.environ.get('DATABASE_PORT'),
@CWKSC
CWKSC / with.jl
Last active January 8, 2022 17:47
Kotlin with in Julia
function changeSymbol(target, to, expr)
function dfs(expr)
args = expr.args
for i in 1:length(args)
arg = args[i]
if arg isa Expr
dfs(arg)
elseif arg isa Symbol
if arg == target
args[i] = to
@CWKSC
CWKSC / rm-all.sh
Created December 28, 2021 06:25
Remove all file under current directory include hidden file
rm -rfv ./{*,.*}
@CWKSC
CWKSC / GenerateFx.cs
Last active April 25, 2021 08:53
One for loop to print diamond star
// https://github.com/CWKSC/Lagrange-Polynomial
// https://github.com/CWKSC/MyLib_Csharp
(double, double)[] points = {
(0, 4),
(1, 1),
(2, 3),
(3, 3),
(4, 2),
(5, 5),
@CWKSC
CWKSC / Direct3D_FPS.cs
Last active December 5, 2020 14:51
CTF - Reversing.Kr
int[] flag = { 0x43, 0x6B, 0x66, 0x6B, 0x62, 0x75, 0x6C, 0x69, 0x4C, 0x45, 0x5C, 0x45, 0x5F, 0x5A, 0x7E, 0x1C, 0x07, 0x25, 0x25, 0x29, 0x70, 0x17, 0x34, 0x39, 0x01, 0x16, 0x49, 0x4C, 0x20, 0x15, 0x0B, 0x0F, 0xF7, 0xEB, 0xFA, 0xE8, 0xB0, 0xFD, 0xEB, 0xBC, 0xF4, 0xCC, 0xDA, 0x9F, 0xF5, 0xF0, 0xE8, 0xCE, 0xF0, 0xA9 };
for (int i = 0; i < flag.Length; i++)
{
((char)(flag[i] ^ i * 4)).Print();
}
// CongratulationF Game Clear! Password is Thr3EDPr0m
@CWKSC
CWKSC / ToMicrosoftJhengHei.js
Last active April 16, 2020 05:42
Change page font family to Microsoft JhengHei by js
document.querySelectorAll('*').forEach(e => e.style.fontFamily = "Microsoft JhengHei");
@CWKSC
CWKSC / IsPrime_int.cs
Last active November 29, 2020 07:27
Fast Prime Test for int ,short
// Prime Test for int //
// Switch will compiled into jump table in Release mode
// Slower when run on Debug mode
// Very stupid but useful
// Try to test execution time compare to normal version
// Speed up 6 - 7 times in my machine
// For Test the range of 2147000000 to 2147483646 for 10 times