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
"caffelatte".chars.tally | |
#=> {"c"=>1, "a"=>2, "f"=>2, "e"=>2, "l"=>1, "t"=>2} |
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
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash | |
$ source ~/.bashrc | |
$ nvm install --lts | |
$ nvm alias default lts/* | |
($ nvm use default) # ターミナルをここで再起動するなら不要 | |
$ npm install --global yarn |
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
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash | |
$ source ~/.bashrc | |
$ nvm install --lts | |
$ nvm alias default lts/* #⬇️入れ替えた | |
$ nvm use default # ⬆️入れ替えた&--ltsをdefaultにした | |
$ npm install --global yarn |
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
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash | |
$ source ~/.bashrc | |
$ nvm install --lts | |
$ nvm use --lts | |
$ nvm alias default lts/* | |
$ npm install --global yarn |
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
$ sudo npm install n -g | |
$ sudo n stable | |
$ sudo apt purge -y nodejs #消す | |
$ exec $SHELL -l # 再起動 | |
$ node -v | |
v.12.14.1 | |
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
%%% | |
%%% これはカスタマイズ用のスタイルファイル。 | |
%%% プロジェクトでLaTeXのスタイルを追加・修正する場合はここに書く。 | |
%%% (reviewやstarterのバージョンアップをしやすくするために、 | |
%%% review initコマンドが用意する「reviewmacro.sty」や、 | |
%%% starterが自動生成する「starter.sty」とは別ファイルにしている) | |
%%% | |
%%% 日本語フォントの太さを細くするよう変更 | |
%%% (Notoフォントを使っていることが前提なので、Docker環境を使うか、 |
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
%%% 日本語フォントの太さを細くするよう変更 | |
%%% (Notoフォントを使っていることが前提なので、Docker環境を使うか、 | |
%%% Notoフォントを自分でインストールすること) | |
%%% 参考:https://tm23forest.com/contents/veryeasy-latex-meiryo-font | |
\special{pdf:mapline uphminr-h unicode NotoSerifCJK-Light.ttc} % 明朝体 | |
\special{pdf:mapline uphgothr-h unicode NotoSansCJK-Light.ttc} % ゴシック体 | |
%%% 英語のセリフ付きフォント(明朝体相当)を細いものに変更 | |
%%% 参考:https://tug.org/FontCatalogue/iwonalight/ | |
\usepackage[light,math]{iwona} |
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
require "minruby" | |
def evaluate(tree, genv, lenv) | |
# pp(tree) | |
case tree[0] | |
when "func_def" | |
genv[tree[1]] = ["user_defind", tree[2], tree[3]] | |
when "lit" | |
tree[1] | |
when "+" |
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
require "minruby" | |
def evaluate(tree, env) | |
# pp(tree) | |
case tree[0] | |
when "lit" | |
tree[1] | |
when "+" | |
evaluate(tree[1], env) + evaluate(tree[2], env) | |
when "-" |
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
require "minruby" | |
def evaluate(tree, env) | |
# pp(tree) | |
case tree[0] | |
when "lit" | |
tree[1] | |
when "+" | |
evaluate(tree[1], env) + evaluate(tree[2], env) | |
when "-" |