Skip to content

Instantly share code, notes, and snippets.

View ssh0's full-sized avatar

Shotaro Fujimoto ssh0

View GitHub Profile
@ssh0
ssh0 / youtube-dl_completion.zsh
Last active January 26, 2024 09:10
zsh-completion function for youtube-dl
#-------- youtube-dl completion
# put this script in your .zshrc
# generated by:
# https://github.com/rg3/youtube-dl/blob/master/devscripts/zsh-completion.in
# https://github.com/rg3/youtube-dl/blob/master/devscripts/zsh-completion.py
# and modified manually by Shotaro Fujimoto (https://github.com/ssh0)
__youtube_dl() {
local curcontext="$curcontext" fileopts diropts cur prev
typeset -A opt_args
@ssh0
ssh0 / youtube-dl_extractors.md
Last active January 4, 2024 10:49
youtube-dl 対応しているサイト一覧
@ssh0
ssh0 / .aliases.mine.zsh
Created June 7, 2015 03:05
My zsh aliases scripts.
# vim: set filetype=zsh
# _ _
# __ _| (_) __ _ ___ ___ ___
# / _` | | |/ _` / __|/ _ \/ __|
# | (_| | | | (_| \__ \ __/\__ \
# \__,_|_|_|\__,_|___/\___||___/
#
# written by Shotaro Fujimoto (https://github.com/ssh0)
#-------- Alias {{{
spacing 18 $ ResizableTall 1 (3/100) (3/5) []
@ssh0
ssh0 / .zshrc
Last active June 29, 2016 09:48
[tmux] 端末起動時に自動で新規セッションを作成 or 既存セッションにアタッチ ref: http://qiita.com/ssh0/items/a9956a74bff8254a606a
if [[ ! -n $TMUX && $- == *l* ]]; then
# get the IDs
ID="`tmux list-sessions`"
if [[ -z "$ID" ]]; then
tmux new-session
fi
create_new_session="Create New Session"
ID="$ID\n${create_new_session}:"
ID="`echo $ID | $PERCOL | cut -d: -f1`"
if [[ "$ID" = "${create_new_session}" ]]; then
@ssh0
ssh0 / file0.txt
Last active March 8, 2016 09:36
コマンドラインで動かすファイルマネージャrangerの設定 ref: http://qiita.com/ssh0/items/fe85da119c93333ba34e
sudo apt-get install ranger w3m lynx highlight atool mediainfo xpdf caca-utils
ranger --copy-config=all
@ssh0
ssh0 / file0.txt
Created November 29, 2015 01:09
[tmux] ペイン移動,削除の際にウィンドウ名をリネームする ref: http://qiita.com/ssh0/items/b12afb372ac48814a17a
# if session has > 1 windows in current, kill-pane without confirmation.
# But confirm before killing pane when it is the last pane in the window.
bind-key -n M-c if "tmux display -p \"#{window_panes}\" | grep ^1\$" \
"confirm-before -p \"Kill the only pane in the window? It will kill this window too. (y/n)\" kill-pane" \
"kill-pane \; run 'tmux rename-window \"#{pane_current_command}\"'"
# move between panes with Alt+j/k
bind-key -n M-j select-pane -t :.+ \; run 'tmux rename-window "#{pane_current_command}"'
bind-key -n M-k select-pane -t :.- \; run 'tmux rename-window "#{pane_current_command}"'
@ssh0
ssh0 / .latexmkrc_dvipng
Last active November 6, 2015 11:20
プレゼンで使う数式画像を作成する[vim + vim-quickrun + latexmk + dvipng] ref: http://qiita.com/ssh0/items/2113db858ba5c9fd05df
#!/usr/bin/perl
$latex = 'platex -interaction=nonstopmode -kanji=utf-8 %O %S';
$pdf_mode = 0;
@ssh0
ssh0 / binds.lua
Last active September 19, 2015 18:47
Webkitベースの軽量ブラウザluakitを使ってみた(vimperatorユーザーにオススメ!) ref: http://qiita.com/ssh0/items/6fd8f3dc49be21fa20c7
ex_follow_bindings = {
-- Yank element uri or description into primary selection
key({}, "y", [[Hint all links (as defined by the `follow.selectors.uri`
selector) and set the primary selection to the matched elements URI.]],
function (w)
w:set_mode("follow", {
prompt = "yank", selector = "uri", evaluator = "uri",
func = function (uri)
assert(type(uri) == "string")
uri = string.gsub(uri, " ", "%%20")
@ssh0
ssh0 / _ranger.zsh
Last active August 29, 2015 14:24
completion function for ranger CLI file manager (ver 1.7.1)
# ranger completion {{{
#------------------------------------------------------------------------------
_ranger() {
typeset -A opt_args
_arguments -s -S \
{-d,--debug}'[Activate the debug mode: Whenever an error occurs, ranger will exit and print a full traceback.]'\
{-c,--clean}'[Activate the clean mode: ranger will not access or create any configuration files nor will it leave any traces on your system.]'\
{-r,--confdir=}'[Change the configuration directory of ranger from ~/.config/ranger to "dir".]:dir:_path_files -/'\
'--copy-config=[Create copies of the default configuration files in your local configuration directory. Existing ones will not be overwritten.]:FILE:(all commands commands_full rc rifle scope)'\