>>> import mraa
>>> led = mraa.Gpio(6) # 初期化
>>> led.dir(mraa.DIR_OUT) # 出力対象としてセット
0
>>> led.getPin() # ピン番号を取得
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
# nodebrew のインストール | |
brew install nodebrew | |
# Node.js のインストール | |
mkdir -p ~/.nodebrew && cd ~/.nodebrew | |
nodebrew install-binary stable # stable は v4.2.1 などでも可 | |
# PATH を登録し、アクティブにする | |
echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bashrc | |
source ~/.bashrc |
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
npm -g install gulp | |
npm install ejs gulp gulp-ejs gulp-plumber --save-dev |
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
npm install babel-plugin-mjsx --save-dev |
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
type Member struct { | |
Number int64 `db:"number"` | |
Name string `db:"name"` | |
} | |
members := []Member{} | |
members = append(members, Member{10, "Lionel"}) | |
members = append(members, Member{9, "Luis"}) | |
fmt.Println(members) // [{101 Lionel true} {102 Luis false}] |
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
contract proofOfBook { | |
mapping(string => uint) books; | |
mapping(address => Log) logs; | |
struct Log { | |
string isbn; | |
uint date; | |
uint rate; | |
} |
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
import ejs from 'gulp-ejs'; | |
gulp.task('ejs', () => { | |
var json = JSON.parse(fs.readFileSync("./src/html/_layout/var.json")); | |
gulp.src(['./src/html/_page/**/*.ejs']) | |
.pipe(ejs(json, {"ext": ".html"})) // "ext" の値を指定 | |
.pipe(gulp.dest('./dist/html/')); | |
}); |