Skip to content

Instantly share code, notes, and snippets.

View aciddust's full-sized avatar
:shipit:
Ram-G Thunder

Seongchuel Ahn aciddust

:shipit:
Ram-G Thunder
View GitHub Profile
@aciddust
aciddust / README.md
Created December 5, 2023 10:54
지난 5년간 시도별 과목별 의원현황
@aciddust
aciddust / main.py
Created June 3, 2023 08:54
Python: access 'method' in 'class' via string
class KV:
store = {}
def __getitem__(self, key):
return getattr(self, key)
def get(cls, key: str) -> str:
return cls.store[key]
def set(cls, key: str, value: str) -> None:
@aciddust
aciddust / README.md
Created May 6, 2023 04:34
Vercel KV example

README

Do not use like this

The GET method is not good for security
because it exposes your bearer token transmitted as a header to the client.

@aciddust
aciddust / lat-lng.csv
Last active December 7, 2022 14:18
degree, minute, seconds, direction converter
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 2.
name,latitude,longitude
Kapuas,0° 13' 7.0998" S,109° 12.516993' E
Mahakam,0° 35' 0.069" S,117° 16.252653' E
Volga,46° 50' 38.0834" N,47° 45.057522' E
Mossy,52° 8' 49.1028" N,106° 38' 49.3224" W
Selenga,52° 9' 11.6658" N,106° 33' 58.6778" E
Yukon,62° 30' 47.7673" N,196° 10.836928' E
Colville,70° 15' 35.6971" N,209° 9' 1.0276" E
@aciddust
aciddust / Input_data.csv
Last active November 5, 2022 02:30
TSP example
NO. XCOORD. YCOORD.
0 0 0
1 50 13
2 47 24
3 5 15
4 5 1
5 44 44
6 27 10
7 38 21
8 24 31
@aciddust
aciddust / README.md
Created October 14, 2022 14:04
Ball collision on Python w/ tkinter

Ball collision on Python

w/ Tkinter

result

@aciddust
aciddust / main.py
Created September 1, 2022 01:07
Change the owner and group of a specific file
from pwd import getpwnam
from grp import getgrnam
from os import popen, chown
def sanitize_file_list(file_list: list) -> list:
"""Remove files that are not in the current directory"""
result = []
for _list in file_list:
if _list[-1] == "." or _list[-1] == "..":
@aciddust
aciddust / README.md
Last active August 23, 2022 09:11
is cluster mode balance all shards when setting many keys?
python test_key_in_balanced.py

SET 100000 keys
CHECK keys in every shards
0: 33300
1: 33388
2: 33312
3: 0
@aciddust
aciddust / redis.conf
Created July 26, 2022 07:45
default redis.conf on centos7
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
#
# ./redis-server /path/to/redis.conf
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
@aciddust
aciddust / README.md
Last active July 15, 2022 01:49
how to disable k8s (feat. docker settings.json)

쿠버네티스 재설치

  1. 도커 설정파일 열어서 쿠버네티스 비활성화
# edit settings.json
code ~/Library/Group Containers/group.com.docker
{
 kubernatesEnabled: false,