Skip to content

Instantly share code, notes, and snippets.

View nwtgck's full-sized avatar
:octocat:
Feel free to make my English natural by native speakers

Ryo Ota nwtgck

:octocat:
Feel free to make my English natural by native speakers
View GitHub Profile
@xuwei-k
xuwei-k / Sudoku.scala
Created September 7, 2024 11:32
sudoku
import scala.compiletime.ops.boolean.&&
type Sudoku[A <: Tuple] = A match {
case (
_1_1 *: _1_2 *: _1_3 *: _1_4 *: _1_5 *: _1_6 *: _1_7 *: _1_8 *: _1_9 *:
_2_1 *: _2_2 *: _2_3 *: _2_4 *: _2_5 *: _2_6 *: _2_7 *: _2_8 *: _2_9 *:
_3_1 *: _3_2 *: _3_3 *: _3_4 *: _3_5 *: _3_6 *: _3_7 *: _3_8 *: _3_9 *:
_4_1 *: _4_2 *: _4_3 *: _4_4 *: _4_5 *: _4_6 *: _4_7 *: _4_8 *: _4_9 *:
_5_1 *: _5_2 *: _5_3 *: _5_4 *: _5_5 *: _5_6 *: _5_7 *: _5_8 *: _5_9 *:
_6_1 *: _6_2 *: _6_3 *: _6_4 *: _6_5 *: _6_6 *: _6_7 *: _6_8 *: _6_9 *:
@voluntas
voluntas / webrtc_turn.rst
Last active September 17, 2024 16:33
WebRTC で利用されいる TURN プロトコルの解説

WebRTC で利用されいる TURN プロトコルの解説

日時:2021-01-29
作:@voluntas
バージョン:2021.2
url:https://voluntas.github.io/

@uhyo
uhyo / gist:f97499872fb0685bd5a4b11fa0f55aef
Last active May 26, 2020 12:23
Sync way of obtaining promise result
Promise.prototype.then = (()=> {
const _then = Promise.prototype.then;
return function(...args) {
_then.call(this, (res) => {
promiseResultMap.set(this, res);
})
this.then = _then;
return _then.apply(this, args);
}
})();
@nukisashineko
nukisashineko / asyncfunction_vs_AsyncFunction.js
Last active March 18, 2020 22:02
nwtgckとの会話の派生でAsyncFunction isなんぞやって確認
// MDN: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction
// 参考:https://javascript.developreference.com/article/14715429/ES+2017%3A+async+function+vs+AsyncFunction(object)+vs+async+function+expression
// Q何しようとしたの?
// A友人が話していたAsyncFunctionオブジェクトを触ってみる
// async function が利用するPromiseはグローバルではなくその場でのスコープ変数らしい。
// AsyncFunctionがスコープ変数を参照できなくしているのってPromiseが動的に書き換えられると面倒だからじゃない?って思ったので実験した
// 結果はまあよくわからなかった。
@waaaaRapy
waaaaRapy / totp.js
Last active November 10, 2023 03:28
Time-Based One-Time Password Generator (RFC6238)
// work on node v10.15.3
const DIGIT = 6;
const TIME_STEP = 30;
/**
* Calculate TOTP value defined in [RFC6238](https://tools.ietf.org/html/rfc6238)
*
* @param {Buffer} key shared secret between client and server
* @param {Date} date date to calculate totp value.
@greymd
greymd / yamaya_fib.md
Last active February 20, 2023 08:12
yamayaさんの難読化シェル芸(フィボナッチ数列) 解説

yamayaさんの難読化シェル芸(フィボナッチ数列) 解説

経緯

(1) ある日、yamaya さんという怖い方がこのツイートを投稿する。

yamaya_src

PHP 10 hrs 33 mins █████████████▍░░░░░░░ 64.0%
TypeScript 2 hrs 7 mins ██▋░░░░░░░░░░░░░░░░░░ 12.9%
Smarty 2 hrs 5 mins ██▋░░░░░░░░░░░░░░░░░░ 12.7%
Nginx 25 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.5%
JavaScript 20 mins ▍░░░░░░░░░░░░░░░░░░░░ 2.0%
import numpy as np
import cv2
FILE_ORG = "calibrated_output_background2.m4v"
WINDOW_ORG = "Orginal_frame"
FRAME_RATE = 30 # fps
class LocationDetector:
def __init__(self,
import cv2
import numpy as np
#動画ファイルパス
ESC_KEY = 27 # Escキー
INTERVAL= 33 # インターバル
FRAME_RATE = 30 # fps
#ウインドウ名の定義
@voluntas
voluntas / webrtc_data_channel.rst
Last active August 27, 2024 08:14
WebRTC DataChannel コトハジメ