This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import path | |
print(path.relpath('/a/b', '/a')) # >>> b | |
print(path.relpath('/a', '/a/b')) # >>> .. | |
from pathlib import Path | |
a = Path('/a') | |
b = Path('/a/b') | |
print(b.relative_to(a)) # >>> b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
remove() { | |
if [ -e $1 ]; then | |
rm -rf $1 | |
fi | |
} | |
remove c | |
echo "c (not optimized) compile" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asdfasdf. asdf | |
asdfasdf. asdf | |
asdfasdf. asdf | |
asdfasdf. asdf | |
asdfasdf. asdf | |
asdfasdf. asdf | |
asdfasdf. asdf | |
asdfasdf asdf | |
asdfasdf asdf | |
asdfasdf asdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from os import path, environ | |
from subprocess import check_output, call | |
from shlex import split | |
from codecs import open | |
home_dir = environ['HOME'] | |
python_path = u''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nim js -o:hellonim.js hellonim.nim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import shutil | |
# コピーしたいディレクトリにいること | |
# os.getcwd() とか ipythonからならpwdでパス確認できる | |
# 違うディレクトリにいたら移動するなりソース修正するなり | |
dstdir = 'コピー先のディレクトリのフルパス' | |
files = os.listdir() | |
num_files = len(files) # 進捗表示用 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if executable('fcitx-remote') | |
autocmd InsertLeave * call system('fcitx-remote -c') | |
else | |
autocmd InsertLeave * set iminsert=0 | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/jedi/parser/grammar3.4.txt b/jedi/parser/grammar3.4.txt | |
index d4a32b8..45f733f 100644 | |
--- a/jedi/parser/grammar3.4.txt | |
+++ b/jedi/parser/grammar3.4.txt | |
@@ -27,7 +27,8 @@ parameters: '(' [typedargslist] ')' | |
typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' | |
['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]] | |
| '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) | |
-tfpdef: NAME [':' test] | |
+tname: NAME [':' test] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import re | |
import asyncio | |
from functools import partial | |
from wdom.document import get_document | |
from wdom.server import get_app, start_server, stop_server | |
from wdom.tag import H1, Div, Button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd cpython | |
make distclean | |
install_dir=$HOME/opt | |
# Install python2 | |
version=2.7.11 | |
pydir=$install_dir/python-$version |