View filter.js
This file contains 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
var words = twotabsearchtextbox.value.split(" "); | |
[...document.querySelectorAll(".s-result-item")] | |
.filter((v) => !words.every((w) => v.textContent.toLowerCase().includes(w))) | |
.forEach((v) => v.style.opacity = "0.3") |
View .js
This file contains 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 app = express(); | |
const _use = app.use; | |
let numUseCalls = 0; | |
app.use = function(...args) { | |
const fn = args[args.length - 1]; | |
// except `express.static()` | |
if (fn && fn.name === 'serveStatic') { | |
_use.apply(this, args); |
View NiceListBox.tsx
This file contains 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 { useFocusRing } from "@react-aria/focus"; | |
import { useListBox, useOption } from "@react-aria/listbox"; | |
import { mergeProps } from "@react-aria/utils"; | |
import { ListProps, ListState, useListState } from "@react-stately/list"; | |
import { Node } from "@react-types/shared"; | |
import { useRef } from "react"; | |
interface ListBoxProps<T> extends ListProps<T> { | |
label?: string; | |
} |
View 2.ts
This file contains 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
interface FruitMap { | |
'Apple': AppleFruit; | |
'Banana': BananaFruit; | |
} | |
type FruitName = keyof FruitMap; | |
type Fruit = FruitMap[FruitName] | |
interface FruitBase<Type extends FruitName> { |
View .ts
This file contains 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
type FruitTemplate<Type extends string, Props> ={ type: Type } & Props | |
type Fruit = | |
| AppleFruit | |
| BananaFruit | |
type AppleFruit = FruitTemplate<'Apple', { | |
sliced: boolean; | |
peeled: boolean; | |
}> |
View draggable.tsx
This file contains 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, { | |
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(''); |
View CounterPage.tsx
This file contains 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, { | |
createContext, useReducer, useContext, useCallback, | |
} from 'react'; | |
type CounterState = { count: number } | |
type CounterAction = | |
| { type: 'increment'; data: { amount: number } } | |
| { type: 'reset' } |
View typescript-mok-mok.md
「JavaScript のまま TypeScript を始める」 + TypeScriptもくもく
JSConf Japan 2019 のセッション「JavaScript のまま TypeScript を始める」をまたお話します。30分。
セッションの後はもくもく会です。TypeScript を知ってる方も知らない方もお越しください。(知ってる方、別にメンターのような役割をして頂かなくても大丈夫です。お気軽に。)
どちらかだけの参加も歓迎します。
JavaScript のまま TypeScript を始める
View setup-firestore-emulator.md
$ firebase setup:emulators:firestore
i firestore: downloading cloud-firestore-emulator-v1.9.0.jar...
Progress: ===================================================> (100% of 61MB
NewerOlder