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
/* checkAbsence.js | |
# 欠席者メール送信プログラム | |
Googleフォームと連携して欠席者のリストを送信するプログラム,Googleフォームのデータから | |
土日はメールの送信をrejectしています,祝祭日は未対応です(gas.sendEmail -> isWeekDay) | |
日別,週別,月別,あるいはすべてのデータを送信します(自動化は別途トリガーで)。 | |
## 使い方 |
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
/* | |
Google Form Generator | |
以下のようなSpreadを作ってmainを実行してください | |
- シート名がファイルの名前とタイトルになります | |
- 答えはいくつでもOKです | |
- 複数シートの場合該当シート上で関数を実行してください | |
- [sample](https://docs.google.com/spreadsheets/d/1lDIZ7cicQUhGod4sTqF8XH9rLYCUspy9F78GMGqLRqY/edit?usp=sharing) | |
細かい説明を書く, point(空白にすると1点,数値を入れるとその点数), 1, 2, 3, 4 | |
問題文, , 正答のインデックス番号, 問1の 答え1, 問1の 答え2, 問1の 答え3, 問1の 答え4 | |
問題文, 5, 正答のインデックス番号, 問2の 答え1, 問2の 答え2, 問2の 答え3, 問2の 答え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
import requests | |
import json | |
create_class = lambda prefix, n: [ f'{prefix}{i + 1:03}' for i in range(n)] | |
base = 'https://judgeapi.u-aizu.ac.jp/users/' | |
header = ['name', 'solved', 'submissions'] | |
users = create_class('s20', 24) + create_class('n20', 30) | |
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
// 関数コンポーネント内で state を扱えるようにするため、React を import 時に useState を読み込む | |
import React, { useState } from 'react' | |
import './App.css' | |
const VueForm = ({selectedValue}) => ( | |
<p> | |
現在選択されている値:<b>{selectedValue}</b> | |
</p> | |
) |
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 React, { useState } from 'react' | |
import './App.css' | |
const VueForm = ({ checkedValue }) => ( | |
<p> | |
現在選択されている値:<b>{checkedValue}</b> | |
</p>) | |
const RadioBtnItems = ({ handleChange, checkedValue, values }) => ( | |
values.map(v => |
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 { useState } from 'react' | |
const FormView = ({ count }) => ( | |
<p>{count}</p> | |
) | |
const ActionView = ({ handleClick }) => ( | |
<button | |
onClick={handleClick} | |
> | |
count up | |
</button> |
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 { useEffect, useState } from 'react' | |
const SampleList = ({ values }) => ( | |
<ul> | |
{ | |
values.map(({ id, item }) => | |
<li key={id}>{item}</li> | |
) | |
} | |
</ul> |
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 { useState, useEffect } from 'react' | |
const Clock = props => { | |
const [date, setDate] = useState(props.date) | |
const tick = () => setDate(new Date()) | |
useEffect(() => { | |
const timerID = setInterval(tick, 1000) | |
return () => clearInterval(timerID) | |
}, []) | |
return ( | |
<div> |
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 React, { useState, useEffect } from "react"; | |
import axios from "axios"; | |
const todoDataUrl = "http://localhost:3100/todos"; | |
function App() { | |
const [todoList, setTodoList] = useState([]); | |
useEffect(() => { | |
const fetchData = async () => { |
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 React, { useState, useEffect } from 'react' | |
const ViewForm = ({ text }) => <p>text: {text}</p> | |
const ActionForm = ({ fn }) => { | |
const [inputValue, setInputValue] = useState('') | |
const handleChange = (e) => { | |
setInputValue(e.target.value) | |
} | |
const handleClick = e => fn(inputValue) |