Skip to content

Instantly share code, notes, and snippets.

my_list = [
1, 2, 3,
4, 5, 6,
]
result = some_function_that_takes_arguments(
'a', 'b', 'c',
'd', 'e', 'f',
)
my_list = [
1, 2, 3,
4, 5, 6,
]
result = some_function_that_takes_arguments(
'a', 'b', 'c',
'd', 'e', 'f',
)
# 不額外做縮排
if (this_is_one_thing and
that_is_another_thing):
do_something()
# 加入註解,可以在支援語法凸顯的編輯器中將兩者區分開來
if (this_is_one_thing and
that_is_another_thing):
# Since both conditions are true, we can frobnicate.
do_something()
@griiid
griiid / _.py
Last active March 18, 2021 13:35
# 沒有垂直對齊時,第一行不應該有參數
foo = long_function_name(var_one, var_two,
var_three, var_four)
# 其他行要多縮一次縮排,不然沒辦法跟再下一層的內容分開
def long_function_name(
var_one, var_two, var_three,
var_four):
print(var_one)
@griiid
griiid / _.py
Last active March 18, 2021 13:33
# 對齊開頭分隔符號
foo = long_function_name(var_one, var_two,
var_three, var_four)
# 要多縮排一次來區分
def long_function_name(
var_one, var_two, var_three,
var_four):
print(var_one)
os.getenv('DBCONN_STR')
@griiid
griiid / _.bash
Last active March 18, 2021 08:34
MODE=development
DBHOST=localhost
DBPORT=5432
DBCONN_STR=${DBHOST}:${DBPORT}
MODE=development
DBHOST=localhost
DBPORT=5432
export DBHOST=localhost
export DBPORT=5432
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi