This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>カメラ起動テスト</title> | |
<style> | |
/* 必要に応じてスタイルを追加してください */ | |
#cameraInput { | |
display: none; | |
} |
This file contains hidden or 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
"use strict"; | |
/** | |
* 経過msを測るだけ。変数の数だけインスタンスを焼いて使うので入れ子でも動く。 | |
* | |
* const sw = StopWatch.start("fileName.methodName"); | |
* // do stuff | |
* sw.stop(); | |
*/ | |
export class StopWatch { |
This file contains hidden or 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
<html> | |
<head> | |
</head> | |
<script language="JavaScript"> | |
window.onload = () => { | |
const h = document.getElementById('h'); | |
const a = document.getElementById('a'); | |
const b = document.getElementById('b'); | |
const g = document.getElementById('g'); | |
window.addEventListener('deviceorientation', (e) => { |
This file contains hidden or 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
<html> | |
<head> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
</head> | |
<body> | |
<div | |
id="btn" | |
style="background-color: ghostwhite;border: 1px dimgray dashed; height: 200px; width: 100%;" | |
></div> | |
<textarea |
This file contains hidden or 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
'use strict'; | |
(() => { | |
const onLoadHandler = (w, h) => console.log(`画像のサイズは ${w} x${h} です。`); | |
const onErrorHandler = (e) => console.error(e); | |
const fetchImage = (loadHandler, errorHandler) => { | |
/* WiFi推奨!このスクリプトを実行すると、約1MBytesの画像を読み込みます! */ | |
const imgDummy = new Image(); | |
imgDummy.onload = () => { // => コールバック登録 |
This file contains hidden or 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
<!-- fragment.htmlファイルのrawのuriを取得し、githubusercontentをgithackに置換する --> | |
<!-- @see https://qiita.com/cognitom/items/041b48d8cf746ab54f06 --> | |
<iframe | |
src="https://gist.githack.com/tsrkzy/bf3a8624976c11d1c5de4d1262144bab/raw/46dfd5777683940b30bf94f891e4f1b73a6687d9/fragment.html"; | |
style="border:none;" | |
width="240" | |
height="240" | |
frameborder="0" /> |
This file contains hidden or 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
'use strict'; | |
import mitt from 'mitt'; | |
(() => { | |
window.onload = () => { | |
const myMitt = new mitt() as TypedMitt<Events> | |
type testPayloadType = Events['test']; | |
myMitt.on('test', (data:testPayloadType) => { | |
console.log(data); |
This file contains hidden or 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
echo $GOPATH | |
# /Users/lepra_tsr/go/third-party:/Users/lepra_tsr/go/myProj | |
ls ~/go | |
~/go | |
/third-party | |
/src | |
/bin | |
/myProj | |
/src |
This file contains hidden or 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 path from 'path'; | |
const entryPoint = path.resolve(__dirname, 'src/client'); | |
const distribute = path.resolve(__dirname, 'public'); | |
/* | |
* ./ | |
* |- src | |
* | |- client.js //-------- entryPoint.jsx | |
* | |- client |
This file contains hidden or 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
/* | |
* @description copy markdown link-text to clipboard as ["${selection}" - ${title} OR ${title}](${pageUri}) | |
* @author tsrm (2017/11/22) | |
* @require Google Chrome | |
* joined ↓ | |
* javascript: (function () { "use strict"; let selectText = window.getSelection().toString().trim(); let textarea = document.createElement("TEXTAREA"); let catchCopy = selectText ? `"${selectText}" - ` : ''; let title = document.title; let anchorText = `${title}`.replace(/([\[\]])/g, '\\$1'); let href = location.href; textarea.innerText = `${catchCopy}[${anchorText}](${href})`; document.body.appendChild(textarea); textarea.select(); document.execCommand('copy'); textarea.remove();})(); | |
*/ | |
(function () { | |
"use strict"; | |
let selectText = window.getSelection().toString().trim(); |
NewerOlder