This file contains hidden or 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 "sinatra" | |
require "json" | |
system("gpio -g mode 14 out; gpio -g mode 17 out; gpio -g mode 27 out; gpio -g mode 15 out") | |
system("gpio -g write 15 0; gpio -g write 27 0") | |
def rad_to_degree(radian) | |
radian.to_f * 180 / Math::PI | |
end |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Fibonacci</title> | |
<script src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/[email protected]/babel.js"></script> | |
<style type="text/css"> | |
<!-- |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Fibonacci</title> | |
<script src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/[email protected]/babel.js"></script> | |
</head> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Fibonacci</title> | |
<script src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/[email protected]/babel.js"></script> | |
</head> |
This file contains hidden or 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
// 1番単純な書き方 | |
function add1(num){ | |
return num + 1 | |
}; | |
console.log(add1(1)); // 2 | |
// 関数リテラルにする | |
add2 = function(num){ | |
return num + 1 | |
}; |
This file contains hidden or 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
■OS のインストール | |
USB 1本とSDカードライタだけでできるUSB OTGを用いたRapsberry Pi Zero WH のセットアップ - Qiita | |
https://qiita.com/Liesegang/items/dcdc669f80d1bf721c21 | |
※もしSSH接続時に「無効なホスト」みたいなエラーが出たらUSBケーブルがデータ転送をサポートしているか等を確認する | |
■パスワード変更 | |
``` | |
passwd | |
``` |
This file contains hidden or 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 "net/http" | |
require "uri" | |
require "aws-sdk-ec2" | |
# 以下を実行し、EC2インスタンスを起動します | |
# 1. 指定のセキュリティグループのInboundルールをすべて削除 | |
# 2. 現在のグローバルIPアドレスの全Allowルールを指定のセキュリティグループに追加 | |
# 3. EC2インスタンス起動 | |
# | |
# 制約事項 |
This file contains hidden or 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 https://checkip.amazonaws.com |
This file contains hidden or 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
TF_LOG=DEBUG | |
をはさむ | |
> TF_LOG=DEBUG terraform init | |
とか |
This file contains hidden or 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
# 文字列を数値に変換する(N進数) | |
irb(main):111:0> "10".to_i | |
=> 10 | |
irb(main):112:0> "10".to_i(2) | |
=> 2 | |
irb(main):113:0> "10".to_i(16) | |
=> 16 | |
irb(main):114:0> "6364".to_i(16) | |
=> 25444 |