Skip to content

Instantly share code, notes, and snippets.

@kuchida1981
kuchida1981 / imagemagick-memo.sh
Created April 9, 2014 03:13
Imagemagickでよく使うコマンドメモ
# memo
@kuchida1981
kuchida1981 / __main__.py
Created April 9, 2014 09:29
Tkinter ウィジェットプレビュー
# coding: utf8
import sys
import Tkinter as Tk
WidgetList = [
'BaseWidget',
'BitmapImage',
'BooleanVar',
'Button',
@kuchida1981
kuchida1981 / currencies.csv
Last active August 29, 2015 13:58
currency
AED http://themoneyconverter.com/rss-feed/AED/rss.xml United Arab Emirates Dirham
ARS http://themoneyconverter.com/rss-feed/ARS/rss.xml Argentine Peso
AUD http://themoneyconverter.com/rss-feed/AUD/rss.xml Australian Dollar
AWG http://themoneyconverter.com/rss-feed/AWG/rss.xml Aruban Florin
BAM http://themoneyconverter.com/rss-feed/BAM/rss.xml Bosnia and Herzegovina convertible mark
BBD http://themoneyconverter.com/rss-feed/BBD/rss.xml Barbadian Dollar
BDT http://themoneyconverter.com/rss-feed/BDT/rss.xml Bangladeshi Taka
BGN http://themoneyconverter.com/rss-feed/BGN/rss.xml Bulgarian Lev
BHD http://themoneyconverter.com/rss-feed/BHD/rss.xml Bahraini Dinar
BMD http://themoneyconverter.com/rss-feed/BMD/rss.xml Bermudian Dollar
@kuchida1981
kuchida1981 / README.md
Created April 15, 2014 03:49
Google Test & CMake Example

Google Test & CMake Example

@kuchida1981
kuchida1981 / doc.md
Created April 21, 2014 03:27
Tkinterネタ 新しいウィンドウの生成

Tkinter で新しいウィンドウ/ダイアログを生成する

新しいウィンドウを生成するにはどうしたらいいか? Toplevel() を使う。

from Tkinter import *

class Mainwindow(Frame):

def init(self, master = None, *args, **kwargs):

@kuchida1981
kuchida1981 / tttk.py
Created April 21, 2014 09:07
Tkinterネタ pack() のデフォルト動作を変える
# coding: utf8
u""" pack()によるウィジェット配置のデフォルト動作を変更する
`pack()` するときには、 `pack(expand = True, fill = BOTH)` とすること多いので
使用例
from tttk import *
@kuchida1981
kuchida1981 / ttty_menu.py
Last active August 29, 2015 14:00
Tkinterネタ Menuのカスタマイズ
# coding: utf8
u""" Tkinter::Menu クラスのカスタマイズ
メニューのラベルに下線付きのショートカットを設定する場合、underline引数を指定し
しないといけない……。
menu_root.add_cascade(menu = menu_files, label = 'File', underline = 0)
面倒ですね。gettextでメニューラベルを複数の言語に対応するのも、現実的じゃない。
@kuchida1981
kuchida1981 / fish_greeting.fish
Last active July 7, 2021 14:41
fish shell 起動時にアップデート可能なパッケージ数を表示
function fish_greeting -d "What's up, fish?"
set_color $fish_color_autosuggestion
set new_packages (command checkupdates)
set new_packages_count (count $new_packages)
if [ $new_packages_count -gt 0 ]
if command echo $new_packages | command grep -q "\slinux\s[0-9]";
command echo (count $new_packages) packages can be upgraded. These packages require restarting system.
else
@kuchida1981
kuchida1981 / ubuntu-20.04-command-not-found.md
Last active July 25, 2021 13:47
Ubuntu 20.04 で command-not-found が機能しなくなった

Ubuntu 20.04 の command-not-found が動かなくなってた. いつからか不明.

$ /usr/lib/command-not-found emacs
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
# プリフィクスを C-l に変更
set-option -g prefix C-l
unbind-key C-b
bind-key C-l send-prefix
# デフォルトシェルを fish とする
set-option -g default-shell /usr/bin/fish
# r で .tmux.conf を再読み込み
bind r source-file ~/.tmux.conf \; display-message "Reloaded"