JSConf Japan 2019 のセッション「JavaScript のまま TypeScript を始める」をまたお話します。30分。
セッションの後はもくもく会です。TypeScript を知ってる方も知らない方もお越しください。(知ってる方、別にメンターのような役割をして頂かなくても大丈夫です。お気軽に。)
どちらかだけの参加も歓迎します。
| import React, { | |
| CSSProperties, useCallback, useEffect, useMemo, useState, useRef, | |
| } from 'react'; | |
| import Head from 'next/head'; | |
| import { Pos } from '../models/Length'; | |
| const DraggablePage: React.FC = () => { | |
| const [dragging, setDragging] = useState(false); | |
| const [from, setFrom] = useState<Pos>({ x: 0, y: 0 }); | |
| const [pointerType, setPointerType] = useState(''); |
| import React, { | |
| createContext, useReducer, useContext, useCallback, | |
| } from 'react'; | |
| type CounterState = { count: number } | |
| type CounterAction = | |
| | { type: 'increment'; data: { amount: number } } | |
| | { type: 'reset' } |
JSConf Japan 2019 のセッション「JavaScript のまま TypeScript を始める」をまたお話します。30分。
セッションの後はもくもく会です。TypeScript を知ってる方も知らない方もお越しください。(知ってる方、別にメンターのような役割をして頂かなくても大丈夫です。お気軽に。)
どちらかだけの参加も歓迎します。
$ firebase setup:emulators:firestore
i firestore: downloading cloud-firestore-emulator-v1.9.0.jar...
Progress: ===================================================> (100% of 61MBReact と Firebase を組み合わせるとアプリをさくさく作れるのでおすすめです。そういう構成の一例を一緒に組み立てていきましょう。自作アプリを作りたい方向けです。
9 月のハンズオンの内容と合わせて利用すると強いかと思います。
| const { Client, DefaultMediaReceiver } = require('castv2-client'); | |
| const googleTTS = require('google-tts-api'); | |
| const address = '192.168.1.86'; | |
| const message = { | |
| language: undefined, // default: 'en' | |
| body: 'Hello World!', | |
| speed: undefined, // default: 1 | |
| timeout: undefined, // default: 1000 | |
| }; |
| // https://api.developer.lifx.com/docs/breathe-effect | |
| (async () => { | |
| const token = prompt('Token?'); | |
| const selector = 'all'; | |
| const url = `https://api.lifx.com/v1/lights/${selector}/effects/breathe`; | |
| const params = { | |
| color: 'red', | |
| cycles: 3, |
| const WebSocket = require('ws'); | |
| let numClients = 0; | |
| // start server | |
| // https://github.com/websockets/ws | |
| const wss = new WebSocket.Server({ | |
| port: 8080, | |
| perMessageDeflate: { | |
| zlibDeflateOptions: { // See zlib defaults. |
| Object.entries(Array.from(document.querySelectorAll('*')) | |
| .reduce((list, el) => { | |
| const styles = window.getComputedStyle(el); | |
| Object.values(styles).forEach((prop) => { | |
| const value = styles[prop]; | |
| if (prop.toLowerCase().includes('color')) { | |
| (value.match(/rgba?\(\d+, \d+, \d+(, \d+(.\d+)?\))?/g) || []) | |
| .map(s => (s.match(/\d+(.\d+)?/g) || []).join(', ')) | |
| .forEach((color) => { | |
| if (!(color in list)) { |