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 / 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 / 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 / redirects-in-react-router-v6.md
Created December 15, 2021 15:52 — forked from mjackson/redirects-in-react-router-v6.md
Notes on handling redirects in React Router v6, including a detailed explanation of how this improves on what we used to do in v4/5

Redirects in React Router v6

An important part of "routing" is handling redirects. Redirects usually happen when you want to preserve an old link and send all the traffic bound for that destination to some new URL so you don't end up with broken links.

The way we recommend handling redirects has changed in React Router v6. This document explains why.

Background

In React Router v4/5 (they have the same API, you can read about why we had to bump the major version here) we had a <Redirect> component that you could use to tell the router when to automatically redirect to another URL. You might have used it like this:

@xoxwgys56
xoxwgys56 / myscript.sh
Created August 5, 2021 00:50 — forked from bradtraversy/myscript.sh
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@xoxwgys56
xoxwgys56 / myscript.sh
Created August 5, 2021 00:50 — forked from bradtraversy/myscript.sh
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@xoxwgys56
xoxwgys56 / gist:ccfdb25a410e48f208fc9c2f9f140c9b
Created July 26, 2021 04:02 — forked from asabaylus/gist:3071099
Github Markdown Heading Anchors

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)

@xoxwgys56
xoxwgys56 / gist:3e53958097ffbe8f153538c3ef9ca1e8
Last active October 25, 2021 02:13 — forked from anthonyray/gist:398fde676a7704c03d6624155ba0011e
Set up OhMyZsh on Amazon EC2 instance running Ubuntu Server 14.04
  1. Connect to your EC2 instance
  2. Install zsh : sudo apt-get update && sudo apt-get install zsh
  3. Edit your passwd configuration file to tell which shell to use for user ubuntu : sudo vim /etc/passwd
  4. Look for ubuntu user, and replace bin/bash by bin/zsh
  5. Install OhMyZsh : sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
  6. Disconnect from your instance and reconnect it.