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
| sed 's/.. / /' monthly_typhoon | sm2 1 1 2 2 | paste - <(tail -n +2 landing.csv ) | sed 's/,$/,0/' | tr , ' ' | awk '$1!=$3 || $2!=$NF | |
| sed 1d landing.csv | awk -F, '{for(i=1;i<=12;i++){a[i]+=$(i+1)}}END{for(k in a){print k" " a[k]"/"NR"="a[k]/NR }}' | sort -n | |
| sed 1d landing.csv | awk -F, '{for(i=1;i<=12;i++){if(i==1 || $i != ""){printf $i;if(i>1){printf ":";print $i;break}}}}' | |
| awk -F, '{for(i=2;i<=13;i++){if($i>0){print $1,i; next}}}' landing.csv | |
| cat monthly_typhoon | grep -v ' 0$' | less | guniq -w4 | sed 's/....//' | awk '{print $1}' | sort | uniq -c |
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
| module.exports = (robot) -> | |
| robot.hear /.+/i, (msg) -> | |
| @exec = require('child_process').exec | |
| user_name= msg.match[0].split(" ")[0]; | |
| Command = msg.match[0].replace(user_name,""); | |
| @exec "#{Command}", (error, stdout, stderr) -> | |
| msg.send error if error? | |
| msg.send stdout if stdout? | |
| msg.send stderr if stderr? |
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
| module.exports = (robot) => { | |
| robot.router.get('/', (req, res) => { | |
| res.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
| module.exports = (robot) => { | |
| robot.router.get('/', (req, res) => { | |
| res.end("ページ"); | |
| robot.send({room: '<チャンネルID>'}, "アクセスあり"); | |
| }); | |
| }; |
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
| const test = new Promise((resolve, reject) => { | |
| setTimeout(()=>{ | |
| console.log("4秒経過"); | |
| resolve(3000); | |
| },4000) | |
| }); | |
| test | |
| .then((sec) => new Promise((resolve) => setTimeout(() => { console.log("7秒経過");resolve(2000); },sec))) //sec=3000 | |
| .then((sec) => new Promise((resolve) => setTimeout(() => { console.log("9秒経過");resolve(1000); },sec))) //sec=2000 |
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
| const timeoutPromise = (sec, msg) => { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(()=>{ | |
| console.log(msg); | |
| resolve(); | |
| },sec) | |
| }); | |
| } | |
| timeoutPromise(4000,"4秒経過") |
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
| const testPromise = (num,sec) => { | |
| const random = Math.round(Math.random() * 10); //ランダムで0〜9の数値を返す | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| console.log(num + ": random is " + random); | |
| if (random === 3) reject("random is three"); | |
| resolve("random is " + random) | |
| },sec); | |
| }) | |
| } |
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
| // Initialize Firebase | |
| const config = { | |
| apiKey: "sakiika_ikaga00sakiika_ikaga", | |
| authDomain: "sakiika-ikaga.firebaseapp.com", | |
| databaseURL: "https://sakiika-ikaga.firebaseio.com", | |
| storageBucket: "sakiika-ikaga.appspot.com", | |
| messagingSenderId: "0123456789" | |
| }; | |
| firebase.initializeApp(config); |
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
| const getList = (snapshot) => { | |
| const obj = snapshot.val(); | |
| if (!obj) return []; | |
| return Object.keys(obj).map((key) => obj[key]); | |
| } |
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
| database.ref('list').once('value').then((snapshot) => { | |
| const list = getList(snapshot); | |
| riot.mount('List', { list }); | |
| riot.mount('Add'); | |
| }) |
OlderNewer