Skip to content

Instantly share code, notes, and snippets.

@matsub
matsub / menu.sh
Last active December 15, 2017 15:13
#/bin/sh
function menu {
# メニューカーソルの位置
choice=0
# メニューを配列でずらっと
menu=(
"First Option"
"Second Option"
"Third Option"
)
@matsub
matsub / MNIST_layered.ipynb
Last active February 6, 2018 08:39
TF Layersでスッとした
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@matsub
matsub / README.md
Last active May 24, 2018 05:36
Tips for playing JavaScript w/ async&await!!

This provides some tips to use async/await in JavaScriiiiptttttt.

@matsub
matsub / App.vue
Last active May 25, 2018 03:53
skyway w/ Vue.js
<template>
<ul>
<li v-for="user in users" :key="user.peerId">
<p><b>{{ user.peerId }}</b></p>
<video style="border: solid 1px" v-on:click="assignVideo(user.stream, $event)" autoplay></video>
</li>
</ul>
</template>
@matsub
matsub / ip_highlight.vim
Last active July 29, 2018 09:57
IPv4 / IPv6 syntax on Vim
syntax match IPv4 /\v((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9])(\/(3[0-2]|[1-2]?[0-9]))?/
syntax match IPv6 /\v([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}/ " 1:2:3:4:5:6:7:8
syntax match IPv6 /\v([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}/ " 1:2:3:4:5:6::8 ~ 1::8
syntax match IPv6 /\v([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}/ " 1:2:3:4:5::8 ~ 1::7:8
syntax match IPv6 /\v([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}/ " 1:2:3:4::8 ~ 1::6:7:8
syntax match IPv6 /\v([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}/ " 1:2:3::8 ~ 1::5:6:7:8
syntax match IPv6 /\v([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}/ " 1:2::8 ~ 1::4:5:6:7:8
syntax match IPv6 /\v[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})/ " 1::8 ~ 1::3:4:5:6:7:8
syntax match IPv6 /\v([0-9a-fA-F]{1,4}:){1,7}:/ " 1:2:3:4:5:6:7::, 1::
syntax match IPv6 /\v:((:[0-9a-fA-F]{1,4}){1,7}|:)/ " ::2:3:4:5:6:7:8, ::2:3:4:5:6:7:8, ::8, ::
@matsub
matsub / superwait.py
Created August 10, 2018 16:20
a memo of xhr
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
from http.server import (
BaseHTTPRequestHandler,
HTTPServer,
)
WAIT_TIME = 1 # sec
@matsub
matsub / VolumeController.html
Created November 16, 2018 06:15
WebRTC+WebAudio
<!doctype html>
<input type="range" value="1" min="0" max="1" step="0.05">
<script src="VolumeController.js"></script>
<script>
async function main() {
const input = document.querySelector("input")
const stream = await navigator.mediaDevices.getUserMedia({
video: false,
audio: true
})
@matsub
matsub / Dockerfile
Created December 8, 2018 05:49
GitHub Actions
FROM alpine:3.8
LABEL "com.github.actions.name"="Hello World"
LABEL "com.github.actions.description"="Write arguments to the standard output"
LABEL "com.github.actions.icon"="anchor"
LABEL "repository"="https://github.com/matsub/try-github-actions"
LABEL "maintainer"="matsub <[email protected]>"
ADD entrypoint.sh /entrypoint.sh
@matsub
matsub / Dockerfile
Created December 8, 2018 12:41
GitHub Apps
FROM python:3.6-alpine3.7
LABEL "com.github.actions.name"="Assign Reviewer"
LABEL "com.github.actions.description"="Assign a PR reviewer when it does not have enough reviewers"
LABEL "com.github.actions.icon"="edit"
LABEL "com.github.actions.color"="blue"
LABEL "repository"="https://github.com/matsub/try-github-actions"
LABEL "maintainer"="matsub <[email protected]>"
@matsub
matsub / test.js
Created December 28, 2018 06:08
testcafeがLoose equalityをstrict equalityとして評価しているように見える
import { Selector } from 'testcafe'
fixture `Loose Equality`
.page `http://localhost:8000/`
test('Say Hello', async t => {
const btn = Selector("button")
await t.click(btn)
// assertion