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
[alias] | |
logtr = log --graph --all --date=short --pretty=format:'%x09%C(green)%h %C(yellow)%cd %x09%C(cyan bold)%an %C(reset)%x09%C(auto)%s %d' | |
logtre = log --graph --all --date=short --pretty=format:'%x09%C(green)%h %C(yellow)%cd %x09%C(cyan bold)%an [%ae] %C(reset)%x09%C(auto)%s %d' | |
logtrec = log --graph --all --date=short --pretty=format:'%x09%C(green)%h %C(yellow)%cd %x09%C(cyan bold)A:%an [%ae]%x09C:%cn [%ce] %C(reset)%x09%C(auto)%s %d' | |
st = status | |
sts = status -s | |
logr = log --grep | |
gr = grep | |
co = checkout | |
cm = commit |
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
書き換え | |
@UserName@ | |
@E-mail@ | |
過去のコミットのアップデート | |
git filter-branch -f --env-filter "GIT_AUTHOR_NAME='@UserName@'; GIT_AUTHOR_EMAIL='@E-mail@'; GIT_COMMITTER_NAME='@UserName@'; GIT_COMMITTER_EMAIL='@E-mail@';" HEAD | |
すべてのバックアップブランチを削除 | |
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d |
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
# install beautifulsoup4 | |
# install ffmpeg-python | |
from bs4 import BeautifulSoup | |
import urllib.request | |
import ffmpeg | |
import re | |
import os | |
save_path = 'C:/Users/' # 保存先パス | |
url = 'http://example.com/' # スクレイピングするURL |
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
m1 = [1 2 3] # 横行列 | |
m2 = [1; 2; 3] # 縦行列 [1, 2, 3]と同等 | |
println("m1 = ", m1) | |
println("m2 = ", m2) | |
# 2×2の行列 | |
m3 = [ | |
2 3; | |
4 5; | |
] |
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
# JuliaではUTF-8エンコードではUnicode文字をサポート | |
# 対話モード(インタプリタ)でバックスラッシュ(円マーク)に続けて記号名称を入力しTabキーを押すことで変換可能 | |
# π は \pi で変換可能 | |
# 円周率の値は pi でも π でも利用可能 | |
println("pi = $(pi), π = $(π))") | |
# 数学でよく使う演算 | |
println("|-10| = ", abs(-10)) # 絶対値 | |
println("√9 = ", sqrt(9)) # 平方根 |
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
for i in 1:5 # i = 1:5と同等 1~5の範囲 | |
print("$i ") | |
end | |
println() | |
for i in 5:-1:1 # 5~1の範囲で-1ずつ変化 | |
print("$i ") | |
end | |
println() |
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
# 一般的な記法の関数定義 | |
function f1(a) | |
return a + 1 | |
end | |
println("f1 : ", f1(3)) | |
# 括弧をつけない関数f1は、関数オブジェクトとして、他の値と同じように受け渡しが可能 | |
g = f1 | |
println("g : ", g(3)) |
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
x = 2 | |
y = 5 | |
# プログラムでの一般的なの書き方 | |
println(0<x && x<3) # true | |
println(0<x && x<1) # false | |
# 数学的な書き方(`&&` の省略) | |
println(0<x<3) # true | |
println(0<x<1) # false |
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
x = 2 | |
y = 3 | |
println("x = $x, y = $y") | |
# 変数を含む計算 (*の省略) | |
println("2x+1 = ", 2x+1) | |
println("(x+2)x = ", (x+2)x) # xを括弧の前にするのは不可 x(x+2) | |
# 表記が関数と混在するため | |
# 除算 |