Skip to content

Instantly share code, notes, and snippets.

View kitsuyui's full-sized avatar
🐢

kitsuyui kitsuyui

🐢
View GitHub Profile
#!/usr/bin/env bash -eu
cd "${0%/*}" && exec > .gitignore
gibo osx
gibo linux
gibo vagrant
gibo python
cat <<'EOF'
.foobar.conf
something_*.log
@kitsuyui
kitsuyui / chromeurls
Last active August 29, 2015 14:15
OS X で Google Chrome の「今開いてる URL とタイトルを全て取得」 ref: http://qiita.com/kitsuyui/items/b65ac4b3ff9d70f677dc
#!/usr/bin/env osascript
set o to ""
tell application "Google Chrome"
repeat with w in windows
repeat with t in (tabs of w)
set o to (o & (url of t) & "\t" & (name of t) & "\n")
end repeat
end repeat
end tell
return text 1 thru -2 of o
@kitsuyui
kitsuyui / autofalke
Last active August 29, 2015 14:15
Python の Lint (文法チェッカ) まとめ - flake8 + hacking を使う - ref: http://qiita.com/kitsuyui/items/5ab4608003a29ff7689f
$ autoflake -i --remove-all-unused-imports --remove-unused-variables main.py
@kitsuyui
kitsuyui / file0.txt
Created March 1, 2015 10:06
Python で stdout/stderr のバッファを無効にするオプション ref: http://qiita.com/kitsuyui/items/7d1704850e503be8dd1c
$ python -c 'import time; print(1); time.sleep(3); print(2)'
1
2
$
@kitsuyui
kitsuyui / Pythonで
Created March 2, 2015 18:29
「 JS のメソッドの貸し借り (apply 使うやつ ) 」を Python でやるには ref: http://qiita.com/kitsuyui/items/0482de343f88399464b7
class A(object):
def __init__(self):
self.value = 1
class B(object):
def __init__(self):
self.value = 2
@kitsuyui
kitsuyui / file0.txt
Last active August 29, 2015 14:16
ローカルの Git リポジトリ消して大丈夫? を確かめる ref: http://qiita.com/kitsuyui/items/e9f04013078e0d31be5a
Bitbucket や GitHub に複製があれば良いので、しばらく使っていない不要なローカルリポジトリは消してしまおうかな。
でも「全ての必要なファイルは復旧できること」「消してしまうファイルは不要なものだけであること」はちゃんと確認したいな。
appcleaner
bettertouchtool
coteditor
dropbox
fluid
google-chrome
karabiner
libreoffice
mono-mdk
sequel-pro
set autoindent
set smartindent
au FileType python setlocal shiftwidth=4 softtabstop=4 expandtab
au FileType yaml setlocal shiftwidth=2 softtabstop=2 expandtab
au FileType Haskell setlocal expandtab
syntax on
set mouse=a
@kitsuyui
kitsuyui / file4.txt
Created March 21, 2015 02:42
その透明な文字に混じらず、見つけ出すんだ。 ref: http://qiita.com/kitsuyui/items/12db383f5e5971f32b08
U+20 SPACE
U+A0 NO-BREAK SPACE
U+2000 EN QUAD
U+2001 EM QUAD
U+2002 EN SPACE
U+2003 EM SPACE
U+2004 THREE-PER-EM SPACE
U+2005 FOUR-PER-EM SPACE
U+2006 SIX-PER-EM SPACE
U+2007 FIGURE SPACE
@kitsuyui
kitsuyui / file0.html
Last active October 19, 2019 12:51
HTML の表 (<table> タグ) をスクレイピングする時も pandas が超便利 ref: https://qiita.com/kitsuyui/items/4906bb457af4d0e2d0a5
<table width="99%" border="1" cellpadding="5" cellspacing="0" class="datatable">
<caption>
所得税の速算表
</caption>
<tr>
<th width="62%" scope="col"> 課税される所得金額</th>
<th width="13%" scope="col"> 税率</th>
<th width="25%" scope="col"> 控除額</th>
</tr>
<tr>