Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>signaling</title>
</head>
<body>
<div class="localVideo">
<video width="320" height="240" style="border: 1px solid black;" autoplay></video>
<button >open camera</button>
@mmitou
mmitou / index.html
Created May 19, 2021 04:41
websocket example on go, echo
<!DOCTYPE html>
<html>
<head>
<title>signaling</title>
</head>
<body>
<div class="websocketControl">
<button class="websocketControl_openCloseButton">open</button>
</div>
version: '3'
services:
db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_PORT: 3306
ports:
- 3306:3306
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
@mmitou
mmitou / babel.config.json
Created December 29, 2020 15:35
jsxサンプル
{
"presets": ["@babel/preset-react"]
}
@mmitou
mmitou / vimrc
Created December 19, 2020 07:28
set hlsearch
set tabstop=2
set shiftwidth=2
set statusline=%f
set laststatus=2
set softtabstop=2
set autowrite
call plug#begin('~/.vim/plugged')
" go
@mmitou
mmitou / main.go
Last active November 22, 2020 17:30
構造体の埋め込みの例
package main
import (
"encoding/json"
"fmt"
)
type Header struct {
ID int
Name string
@mmitou
mmitou / main.go
Created November 21, 2020 09:01
汎用的な構造体初期化関数の例
package main
import "fmt"
func main() {
foo := Foo{}
InitFoo(&foo)
fmt.Printf("%+v\n", foo)
bar := Bar{}
package main
import (
"fmt"
"github.com/go-playground/validator/v10"
)
type Hoge struct {
Num string `validate:"number"`
type propertyValuType<T, Key, KeyOriginal> = Key extends keyof T
? KeyOriginal[] extends Key[]
? T[Key]
: never
: never;
type PropertyValueType<T, Key> = propertyValuType<T, Key, Key>;
type isPropertyKey<T, Key, KeyOriginal> = Key extends keyof T
? KeyOriginal[] extends Key[]
@mmitou
mmitou / gist:de1899654cd22e7054b81b0b414ce379
Created October 9, 2020 06:41
to compile Method Decorators, it needs options below
tsc --target ES5 --emitDecoratorMetadata --experimentalDecorators