Skip to content

Instantly share code, notes, and snippets.

View omas-public's full-sized avatar

Omas Naohiko omas-public

View GitHub Profile
// 関数コンポーネント内で state を扱えるようにするため、React を import 時に useState を読み込む
import React, { useState } from 'react'
import './App.css'
const VueForm = ({selectedValue}) => (
<p>
現在選択されている値:<b>{selectedValue}</b>
</p>
)
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)
/*
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
/* checkAbsence.js
# 欠席者メール送信プログラム
Googleフォームと連携して欠席者のリストを送信するプログラム,Googleフォームのデータから
土日はメールの送信をrejectしています,祝祭日は未対応です(gas.sendEmail -> isWeekDay)
日別,週別,月別,あるいはすべてのデータを送信します(自動化は別途トリガーで)。
## 使い方
import React from 'react'
import sa from 'superagent'
class App extends React.Component {
constructor (props) {
super(props)
this.state = { items: null }
}
async loadedJSON () {
const getAPI = uri =>
@omas-public
omas-public / App.css
Last active December 19, 2019 12:24
Code prep Todo css
body {
margin:0;
padding: 20px;
background: #FFF7FF;
}
.todo {
width:100%;
max-width:25rem;
margin:0 auto;
padding:20px;
@omas-public
omas-public / App.jsx
Created December 12, 2019 11:55
React Form(p158)
import React from 'react'
import {
TextField,
Button,
FormControl,
makeStyles,
createStyles
} from '@material-ui/core'
const App = props => {
@omas-public
omas-public / Template.html
Last active December 6, 2019 04:55
いまどきのJSプログラマーのためのNode.jsとReactアプリケーション
<!DOCTYPE html>
<meta charset="utf-8">
<title>test</title>
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>
<div id="root"></div>
<script type="text/babel">
const getCurrentPosition = async () => {
const geolocation = options => new Promise((resolve, reject) =>
navigator.geolocation.getCurrentPosition(resolve, reject, options)
)
const options = { enableHighAccuracy: true }
const position = await geolocation(options)
.then(json => json.coords)
.then(coords => ({ latitude: coords.latitude, longitude: coords.longitude }))
.catch(error => console.log(error))
@omas-public
omas-public / Template.jsx
Last active January 30, 2020 07:48
API template pattern
import React from 'react'
import {
Card,
CardHeader,
CardContent,
CardActions
// List,
// ListItem,
// ListItemText,
// TextField