Skip to content

Instantly share code, notes, and snippets.

View xoxwgys56's full-sized avatar
๐Ÿšถ
As it was

Yoooda xoxwgys56

๐Ÿšถ
As it was
View GitHub Profile
@xoxwgys56
xoxwgys56 / README.md
Last active December 12, 2023 04:43
Python MRO
autoload -Uz vcs_info
precmd() { vcs_info }
zstyle ':vcs_info:git:*' formats '%b '
setopt PROMPT_SUBST
PROMPT='%F{#f8f8f2}%*%f %F{#bd93f9}%2~%f% %F{#ff5555}${vcs_info_msg_0_}%f$ '
@xoxwgys56
xoxwgys56 / django_queryset_simple.py
Created December 20, 2022 00:43 — forked from KimSoungRyoul/django_queryset_simple.py
Django QuerySet ๊ตฌ์„ฑ์š”์†Œ ๊ฐ„๋‹จํ•˜๊ฒŒ
from django.db.model.sql import Query # Query()๋Š” ๊ฐœ๋ฐœ์ž๊ฐ€ ์ •์˜ํ•œ QuerySet์„ ์ฝ์–ด์„œ ์‹ค์ œ SQL์„ ์ƒ์„ฑํ•ด์ฃผ๋Š” ๊ตฌํ˜„์ฒด๋‹ค
class QuerySet:
query: Query = Query() # ์ด๊ฒƒ์„ ๋‚˜๋Š” ๋ฉ”์ธ์ฟผ๋ฆฌ ๋ผ๊ณ  ๋ช…๋ช…ํ•œ๋‹ค.
_result_cache: List[Dict[Any,Any]] = dict() # SQL์˜ ์ˆ˜ํ–‰๊ฒฐ๊ณผ๋ฅผ ์—ฌ๊ธฐ ์ €์žฅํ•ด๋†“๊ณ  ์žฌ์‚ฌ์šฉํ•œ๋‹ค (QuerySet Cache)
# QuerySet ์žฌํ˜ธ์ถœ์‹œ ์ด ํ”„๋กœํผํ‹ฐ์— ์ €์žฅ๋œ ๋ฐ์ดํ„ฐ๊ฐ€ ์—†์œผ๋ฉด SQL์„ ํ˜ธ์ถœํ•ด์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜จ๋‹ค.
_prefetch_related_lookups: Tuple[str] = () # prefetch_related(์—ฌ๊ธฐ์„ ์–ธ๋œ ๊ฐ’๋“ค) ์„ ์ด ํ”„๋กœํผํ‹ฐ์— ์ €์žฅํ•จ
# ์ด๊ฒƒ์„ ๋‚˜๋Š” ์ถ”๊ฐ€์ฟผ๋ฆฌ(์…‹)์ด๋ผ๊ณ  ๋ช…๋ช…ํ•œ๋‹ค.
@xoxwgys56
xoxwgys56 / README.md
Created December 9, 2022 05:25
zsh prompt

zsh prompt

show near by 2 directory only

# prompt
autoload -Uz vcs_info
precmd() { vcs_info }

zstyle ':vcs_info:git:*' formats '%b '
@xoxwgys56
xoxwgys56 / Dockerfile
Created October 19, 2022 02:39
no-gil test
FROM nogil/python
WORKDIR /
# If enable gil uncomment below:
# ENV PYTHONGIL=1
COPY ./main.py /main.py
CMD ["python", "/main.py"]
@xoxwgys56
xoxwgys56 / populate.sh
Created June 22, 2022 03:09
django populate data for testing
#!/bin/sh
# use this line. if you want interact with terminal
#
# docker-compose exec web python3 manage.py createsuperuser --username "admin" --email "[email protected]"
# populate data for testing
#
# NOTE below code affect indent
docker-compose exec web sh -c "
@xoxwgys56
xoxwgys56 / install-docker.md
Created April 27, 2022 03:42 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@xoxwgys56
xoxwgys56 / index.html
Created January 17, 2022 04:36
Tic Tac Toe
<div id="errors" style="
background: #c00;
color: #fff;
display: none;
margin: -20px -20px 20px;
padding: 20px;
white-space: pre-wrap;
"></div>
<div id="root"></div>
<script>
@xoxwgys56
xoxwgys56 / index.html
Created January 17, 2022 04:36
Tic Tac Toe
<div id="errors" style="
background: #c00;
color: #fff;
display: none;
margin: -20px -20px 20px;
padding: 20px;
white-space: pre-wrap;
"></div>
<div id="root"></div>
<script>