(() => {
// define function
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 createInfo = (start, max) => { | |
| const threads = GmailApp.getInboxThreads(start, max) | |
| const matrix = threads.map(v => ( | |
| [ | |
| v.getId(), | |
| v.getFirstMessageSubject(), | |
| v.getMessageCount() | |
| ] | |
| )) | |
| return matrix |
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 | |
| VERSION='90' | |
| TUTOR_DIR="/usr/share/vim/vim$VERSION/tutor" | |
| TUTOR_JA=$(tempfile -p 'ja') | |
| TUTOR=$(tempfile -p 'en') | |
| chmod +w $TUTOR | |
| cp $TUTOR_DIR/tutor.ja.utf-8 $TUTOR_JA | |
| cp $TUTOR_DIR/tutor $TUTOR |
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) |
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 { 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 { 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 } 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 React, { useState } from 'react' | |
| import './App.css' | |
| const VueForm = ({ checkedValue }) => ( | |
| <p> | |
| 現在選択されている値:<b>{checkedValue}</b> | |
| </p>) | |
| const RadioBtnItems = ({ handleChange, checkedValue, values }) => ( | |
| values.map(v => |