Skip to content

Instantly share code, notes, and snippets.

View wonderer80's full-sized avatar
๐Ÿ˜†
๊ฑด๊ฐ•ํ•œ ๊ฐœ๋ฐœ์ž๊ฐ€ ๋˜๊ธฐ ์œ„ํ•ด ๋…ธ๋ ฅ ์ค‘!

Jeonghun Kim(Lyle) wonderer80

๐Ÿ˜†
๊ฑด๊ฐ•ํ•œ ๊ฐœ๋ฐœ์ž๊ฐ€ ๋˜๊ธฐ ์œ„ํ•ด ๋…ธ๋ ฅ ์ค‘!
View GitHub Profile

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@wonderer80
wonderer80 / output_query.py
Last active February 9, 2022 02:42
Django shell ์—์„œ queryset ์‹คํ–‰ ๋  ๋•Œ SQL์„ ์ฝ˜์†” ์ถœ๋ ฅํ•˜๊ธฐ
from django.test.utils import CaptureQueriesContext
from django.db import connections
from contextlib import ExitStack
import logging
logger = logging.getLogger('django.db.backends')
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())
for connection in connections.all():
@wonderer80
wonderer80 / auto_correct.sh
Created March 26, 2019 07:28
staging ๋œ ํŒŒ์ผ๋“ค์„ rubocop ์ž๋™ ๊ต์ •
#!/bin/sh
#
FILES="$(git diff --cached --name-only --diff-filter=AMC | grep "\.rb$" | tr '\n' ' ')"
bundle exec rubocop -a ${FILES}
@wonderer80
wonderer80 / pre-commit
Last active July 31, 2020 09:05
commit ์ „์— rubocop ๊ฒ€์‚ฌํ•˜๊ธฐ
#!/bin/sh
#
# Check for ruby style errors
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
NC='\033[0m'
if git rev-parse --verify HEAD >/dev/null 2>&1
@wonderer80
wonderer80 / prune_branch.sh
Created February 7, 2019 05:36
๋ฆฌ๋ชจํŠธ์— ์—†๋Š” ๋กœ์ปฌ ๋ธŒ๋žœ์น˜ ์ •๋ฆฌํ•˜๊ธฐ
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
@wonderer80
wonderer80 / connect_servers.rb
Last active March 26, 2019 07:29
iterm์—์„œ IP ๋ฆฌ์ŠคํŠธ๋“ค์— ssh ์ ‘์†ํ•˜๊ธฐ
ip_list = ARGF.read.gsub('"', '').split("\n")
# ์ตœ๋Œ€ 10๊ฐœ ๊นŒ์ง€๋งŒ ๊ฐ€๋Šฅ
number_string = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth']
row_number = (ip_list.size / 2.to_f).ceil
add_x = row_number - 2
add_x = 0 if add_x < 0