Skip to content

Instantly share code, notes, and snippets.

View dgkim5360's full-sized avatar
🏛️
Working in an isolated world

Don Kim dgkim5360

🏛️
Working in an isolated world
View GitHub Profile
@dgkim5360
dgkim5360 / cheatsheet-pdb.md
Created October 13, 2017 07:52
DIY stuffs for the first steps of Python pdb, summarized from https://pymotw.com/3/pdb

Starting the Debugger

From the command line

$ python3 -m pdb myscript.py  

Within the interpreter

$ python3
@dgkim5360
dgkim5360 / vim-first-steps.md
Last active February 8, 2018 01:32
DIY stuffs for the first step of Vim

Vimtutor

Moving the cursor in the normal mode :help usr_03

  • h j k l :help hjkl
  • 0 $
  • gg G
  • #G
  • <CTRL-O> <CTRL-I>
  • w e
  • %
@dgkim5360
dgkim5360 / basic-virtualenvwrapper-ubuntu.sh
Last active October 14, 2017 02:43
sample scripts and outputs for virtualenvwrapper in Ubuntu
sudo apt install virtualenv
sudo apt install virtualenvwrapper
# if workon does not work, try restarting the terminal
workon # no existing virtual environments (c.f. lsvirtualenv)
mkvirtualenv --python=$(which python) myfirst # init Python 2 virtualenv
#New python executable in /home/don/.virtualenvs/myfirst/bin/python
#Installing setuptools, pip, wheel...done.
# === (myfirst) $ prompt begins
@dgkim5360
dgkim5360 / setup-initial.sh
Last active October 17, 2017 08:10
A personal setup list for initializing an Ubuntu desktop (currently of version 16.04 LTS)
sudo apt update
sudo apt upgrade
# Basic tools
sudo apt install curl pdftk asciidoc tmux git
# tmuxifier https://github.com/jimeh/tmuxifier
git clone --depth=1 https://github.com/jimeh/tmuxifier.git ~/.tmuxifier
# add path via .bashrc -- export PATH="$HOME/.tmuxifier/bin:$PATH"
@dgkim5360
dgkim5360 / mithrilMarkdownEditorModel.js
Last active May 25, 2017 08:55
an example mithril code for a markdown editor (with bootstrap 4 CSS classes) that auto-translates and syncs the scrolls
"use strict"
const m = require("mithril")
const Sample = {
currentMark: `# h1 Heading
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
@dgkim5360
dgkim5360 / mithrilTagsInput.js
Last active May 22, 2017 08:38
an example mithril code (with bootstrap CSS classes) for the input component of tags
"use strict"
const m = require("mithril")
// Model
const Tags = {
list: [],
add: function(e) {
if (e.keyCode === 13) {
Tags.list.push(e.target.value)
e.target.value = ""