Skip to content

Instantly share code, notes, and snippets.

View timotheuslin's full-sized avatar

Timothy Lin timotheuslin

  • -
  • Redmond, Washington
View GitHub Profile
@timotheuslin
timotheuslin / gist:cb4fb965c6fe18ad9b972b4effb5269a
Last active October 2, 2020 18:48 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date
  1. Setup your cloned-fork:

    git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
    cd into/cloned/fork-repo

  2. Add remote from original repository in your forked repository:

    git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
    git fetch upstream

  3. Merge upstream's master branch
    > git merge upstream/master

@timotheuslin
timotheuslin / atomic_counter.py
Created May 26, 2019 20:30 — forked from benhoyt/atomic_counter.py
An atomic, thread-safe incrementing counter for Python
"""An atomic, thread-safe incrementing counter."""
import threading
class AtomicCounter:
"""An atomic, thread-safe incrementing counter.
>>> counter = AtomicCounter()
>>> counter.increment()
@timotheuslin
timotheuslin / Makefiles.md
Created August 22, 2019 22:30 — forked from evertrol/Makefiles.md
Makefile cheat sheet

Makefile cheat sheet

Mostly geared towards GNU make

I've used ->| to indicate a tab character, as it's clearer to read than

  • Set a target, its dependencies and the commands to execute in order
target: [dependencies]
->| 
@timotheuslin
timotheuslin / scandir.py
Last active April 5, 2020 05:07
A customized scandir() which honors: (1)the non-traverse anchor files, (2) the excluded file pattern.
""" A customized scandir() which honors: (1)the non-traverse anchor files, (2) the
excluded file pattern.
Timothy Lin (c) 4/4/2020
"""
__all__ = ['scandir', 'NO_TRAVERSE_ANCHOR']
import os
import sys

追記(2017.06.03)

WinPDBのフォークがPython3サポートしてました。こっちを使いましょう。

https://github.com/bluebird75/winpdb

次のように対象プログラムを実行するインタプリタを指定できます。

python -m winpdb -i python3 my_program.py