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
| use std::env; | |
| fn main(){ | |
| let args: Vec<String> = env::args().collect(); | |
| let num:i32 = args[1].parse::<i32>().unwrap(); | |
| println!("{0: >width$ }","人", width= 2 + 2*num as usize); | |
| for i in 0..num { | |
| let width_left = (2*num - i*2 - 1) as usize; | |
| let width_right = (i*4 + 4) as usize; |
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
| 🍣: 🐟 🍚 | |
| echo 🐟🍚 → 🍣 | |
| 🐟: 🐛 | |
| echo 🐛 → 🐟 | |
| 🌾: 💩 | |
| echo 💩 → 🌾 | |
| 🐛: 🌿 | |
| echo 🌿 → 🐛 | |
| 🍚: 🌾 | |
| echo 🌾 → 🍚 |
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
| #!/bin/bash | |
| ###文献リスト### | |
| cat ../rpim_book.bbl | | |
| grep '^\\bibitem' | | |
| sed 's/bibitem/cite/' | | |
| awk '{print "s/\\"$1"/["NR"]/g"}' > ./cite.sed | |
| cat ../rpim_book.bbl | | |
| sed 's/bibitem/cite/' | |
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
| pi@raspberrypi ~ $ git clone https://github.com/ryuichiueda/RobotDesign3.git | |
| pi@raspberrypi ~ $ cd RobotDesign3/ | |
| pi@raspberrypi ~/RobotDesign3 $ sudo make | |
| ...(ログはちゃんと見ましょう) | |
| insserv: warning: script 'K01robot_design_3.sh' missing LSB tags and overrides | |
| (↑このワーニングは無視でOK) | |
| pi@raspberrypi ~/RobotDesign3 $ sudo reboot | |
| (再度接続) | |
| #確認方法1(プロセスが立ち上がっているか調査) | |
| pi@raspberrypi ~ $ ps aux | grep robot | grep 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
| curl -s "http://kokkai.ndl.go.jp/api/1.0/speech?$(echo "maximumRecords=100&any=と呼ぶ声あり" | nkf -MQ | tr -d '\n' | gsed 's/=\+/%/g')" | grep -o "「.*」" |
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
| $ cat holidays | awk '{print $1,$NF}' | awk '{print $1,a,b,$2;a=b;b=$2}' | grep '1 0 1$' | awk '{print $1}' | while read d ; do echo '----' ; grep -B2 $d holidays ; done |
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
| #!/bin/sh | |
| set -e | |
| npm install | |
| export PORT=8989 | |
| export PATH="node_modules/.bin:node_modules/hubot/node_modules/.bin:$PATH" | |
| export HUBOT_SLACK_TOKEN=xxxxxx | |
| export HUBOT_GITHUB_SECRET=yyyyyyy |
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
| # GitHubから来た通知をSlackに飛ばす | |
| # | |
| # 参考: Hubot経由でGitHubのイベントを通知する | SPACEMARKET BLOG | |
| # http://blog.spacemarket.com/code/hubot-github-webhook-1/ | |
| crypto = require 'crypto' | |
| module.exports = (robot) -> | |
| robot.router.post "/github/webhook", (req, res) -> | |
| event_type = req.get 'X-Github-Event' | |
| signature = req.get 'X-Hub-Signature' |
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
| ueda@ubuntu14:~$ sudo udevadm monitor --kernel --property | |
| [sudo] password for ueda: | |
| monitor will print the received events for: | |
| KERNEL - the kernel uevent | |
| KERNEL[443.349199] remove /devices/virtual/sushi/sushi0 (sushi) | |
| ACTION=remove | |
| DEVNAME=/dev/sushi0 | |
| DEVPATH=/devices/virtual/sushi/sushi0 | |
| MAJOR=249 |
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
| ueda@ubuntu14:~$ sudo udevadm monitor --kernel --property | |
| monitor will print the received events for: | |
| KERNEL - the kernel uevent | |
| KERNEL[159.305967] add /module/sushi (module) | |
| ACTION=add | |
| DEVPATH=/module/sushi | |
| SEQNUM=1568 | |
| SUBSYSTEM=module |