Set the maximum line length in PyCharm

This is how I do it for PyCharm Community Edition 2018.1 on osx. PyCharm -> Preferences -> Editor -> Code Style -> Visual guides I set it to 79 chars. Ref: https://stackoverflow.com/questions/17319422/how-do-i-set-the-maximum-line-length-in-pycharm https://stackoverflow.com/questions/15438326/python-pep-8-docstring-line-length

May 17, 2018 · 1 min · birdchan

In a bad state in git

After some rebase, merge and git stash, sometimes I found myself in a bad git state, like a detached head state or in the middle of some messy conflict resolving, whatever that means. What to do? First question to ask yourself, can I afford to throw away my current changes? If the answer is yes, then there are many options. Here are a few: [code] rm -rf git_dir/ git clone https://some.git.clone.path [/code] ...

May 15, 2018 · 1 min · birdchan

Hold on, Hold Off

Hold on: to wait E.g. Hold on until mom is here. Hold off: to postpone, cancel, or stop an action E.g. He held off preparation for the business trip. Just to confuse you more… Hold off on: E.g. She decided to hold off on her vacation plan. Hold off from: E.g. He held off from entering the house. Ref: http://www.differencebetween.net/language/difference-between-hold-on-or-hold-off/ https://www.merriam-webster.com/dictionary/hold%20off%20on

May 7, 2018 · 1 min · birdchan

How fake handbags fund terrorism and organized crime

https://www.ted.com/talks/alastair_gray_how_fake_handbags_fund_terrorism_and_organized_crime

May 6, 2018 · 1 min · birdchan

Visualizing Pandas' Pivoting and Reshaping Functions

This will come in handy someday. http://jalammar.github.io/visualizing-pandas-pivoting-and-reshaping/

May 5, 2018 · 1 min · birdchan

Same life

“If you keep living like the way you are now, you will continue to produce the same life you already have.” - Jim Rohn

May 3, 2018 · 1 min · birdchan

Ask for forgiveness, not permission

If it isn’t going to devastate those around you, try it and then justify it. People — whether parents, partners, or bosses—deny things on an emotional basis that they can learn to accept after the fact. If the potential damage is moderate or in any way reversible, don’t give people the chance to say no. Most people are fast to stop you before you get started but hesitant to get in the way if you’re moving. Get good at being a troublemaker and saying sorry when you really screw up. ...

April 25, 2018 · 1 min · birdchan

How HTTPS works

Nice comics to explain how https works. https://howhttps.works/

April 24, 2018 · 1 min · birdchan

Regex lookahead and lookbehind

(?=foo) Lookahead Asserts that what immediately follows the current position in the string is foo (?<=foo) Lookbehind Asserts that what immediately precedes the current position in the string is foo (?!foo) Negative Lookahead Asserts that what immediately follows the current position in the string is not foo (?<!foo) Negative Lookbehind Asserts that what immediately precedes the current position in the string is not foo Ref: http://www.rexegg.com/regex-lookarounds.html

April 23, 2018 · 1 min · birdchan

Replacing jQuery With Vue.js

Good read. Replacing jQuery With Vue.js: No Build Step Necessary

April 22, 2018 · 1 min · birdchan