Skip to content

Instantly share code, notes, and snippets.

@ryotako
ryotako / julia_set.pyde
Last active February 2, 2022 13:19
Julia set with Processing.py
julia = (-0.754567,-0.209658)
# julia = (-0.3, -0.63)
# julia = (0.285, 0.01)
def setup():
size(400,400, P2D)
pixelDensity(displayDensity())
frameRate(50)
print julia
@ryotako
ryotako / sketch_190414a.pyde
Created April 14, 2019 13:12
行列積&非線形変換による何か
def setup():
size(*[360]*2)
global A, B, C, h
h = 180
A = [[random(-1, 1) for _ in range(3)] for _ in range(3)]
B = [[random(-1,1) for _ in range(3)] for _ in range(3)]
C = [[random(-1,1) for _ in range(3)] for _ in range(3)]
@ryotako
ryotako / man_argparse.md
Last active May 26, 2023 01:32
argparseの日本語訳(若干の意訳を含む)

argparse(1)

名称

argparse - argparse - fishのスクリプトや関数に渡されるオプションの解析

記述

このコマンドはfishのスクリプトや関数が,fishのビルトイン関数が引数を扱うのと100%同じ方法で引数を取り扱うのを簡単にします. ユーザは有効なオプションを定義する引数の組を渡し,リテラル--を続け,その後に解析される引数(リテラル--を含んでもよい)を渡します. これに関する詳細は以下の「使い方」の節で述べます.

@ryotako
ryotako / volt.fish
Created December 27, 2017 10:17
volt.fish
# Defined in /Users/Ryota/.config/fish/functions/volt.fish @ line 2
function volt
set -q VOLTPATH
and set -l voltpath $VOLTPATH
or set -l voltpath "$HOME/volt"
switch "$argv[1]"
case ""
volt repo
case up
@ryotako
ryotako / funcgist.fish
Last active December 27, 2017 03:11
funcgist.fish
# Defined in /Users/Ryota/.config/fish/functions/funcgist.fish @ line 1
function funcgist
if not type -q gist
echo "funcgist: command 'gist' is required" >&2
end
argparse -n funcgist 'h/help' 'd/description=' -- $argv
or return 1
if set -q _flag_h
@ryotako
ryotako / p.fish
Created December 27, 2017 03:09
p.fish
p is a function with definition
# Defined in /Users/Ryota/.config/fish/functions/p.fish @ line 1
function p --no-scope-shadowing
#
# use any variables except for `argv`
#
if set -q argv[1]
set_color red
if test $argv[1] = argv
set -e argv
@ryotako
ryotako / def.fish
Last active December 27, 2017 03:08
def.fish
def is a function with definition
# Defined in /Users/Ryota/.config/fish/functions/def.fish @ line 2
function def --description 'manage fish functions/complitons'
# --help option: show usage and exit
function __def_usage
echo "NAME: def - Manage your local function definitions"
echo
echo "USAGE: def [options] function-names..."
echo
echo "OPTIONS:"
@ryotako
ryotako / addb.fish
Last active January 22, 2017 08:35
fishのビルトインコマンドだけでegzactを書く練習
function addb
while read -l line
echo $line
end
if count $argv >/dev/null
echo $argv[1]
end
end
@ryotako
ryotako / help-ja.fish
Last active November 29, 2021 08:22
るびきちさんの「全訳!fishシェル普及計画」を引くコマンド
function help-ja --description 'Show Japanese help for the fish shell'
 set -l topics (builtin -n) tutorial document-ja faq-ja design-document-ja
set -l home 'http://fish.rubikitch.com'
switch "$argv[1]"
case -h --h --he --hel --help
echo 'Usage: help-ja [TOPIC]'
case $topics
open "$home/$argv[1]"
case '*'
@ryotako
ryotako / .vimrc
Created October 19, 2016 13:37
colorcolumnのトグル
" 80文字範囲外塗りつぶしのオンオフ
function! s:ToggleMargin()
let value = &colorcolumn
if strlen(value)
set colorcolumn=""
set colorcolumn?
else
execute "set colorcolumn=".join(range(&textwidth+1, 999), ',')
echo " colorcolumn=81..."
endif