Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@uupaa
uupaa / image.resize.in.github.flavored.markdown.md
Last active April 15, 2024 17:23
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)
@uupaa
uupaa / AVCDecoderConfigurationRecord.md
Last active December 12, 2023 11:38
parse AVCDecoderConfigurationRecord example

以下は、AVCDecoderConfigurationRecord のバイトデータです。

ADDR    0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
------ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
000000 00 00 00 2e 61 76 63 43 01 42 c0 1e ff e1 00 16
000010 67 42 c0 1e d9 02 04 68 40 00 00 03 01 40 00 00
000020 03 00 83 c5 8b 92 01 00 05 68 cb 83 cb 20
@uupaa
uupaa / get.path.for.node.js.md
Last active December 5, 2023 11:18
node.js で絶対パスや相対パスを取得する方法 npm __dirname

node.js でパスを取得する方法についてのメモ

$ node ~/hoge/Foo.js/a.js

を実行したときに、

  • process.argv[1] から、node コマンドに指定された a.js のパス( ~/hoge/Foo.js/a.js )を取得できます
@uupaa
uupaa / reveal.js pdf print out.md
Last active September 19, 2023 00:51
reveal.js で pdf 印刷

Chrome 上で reveal.js で作成したスライドを pdf 化する手順メモ

  • URL に ?print-pdf を追加する
  • CMD + P で印刷ダイアログを表示し、出力先を pdf に設定
  • 出力

出力された pdf を確認し、リンクが表示されていないなど表示がおかしい場合は以下の事を試す(ここからが本題)

reveal.js/out.html の document.write している行をコメントアウトし、css/print/pdf.css を直接追加。

@uupaa
uupaa / TS2488.md
Last active May 3, 2023 21:20
How to fix and fine tune TypeScript compilation errors: TS2488, TS7053

Before

  static split_semver(s:string) {
    // @arg String - "version-99.88.77"
    // @ret NumberArray - [ 99. 88, 77 ]
    try {
      const [, major, minor, patch] = Array.from(s.match(/(\d{1,2})\.(\d{1,2})\.(\d{1,2})/)); // [, "99", "88", 77" ]
      return [
 parseInt(major, 10),
@uupaa
uupaa / nginx.conf
Last active February 28, 2023 09:29
nginx: Avoid CORS and reverse proxy settings
http {
server {
listen 8080;
server_name localhost;
charset UTF-8;
# Avoid CORS and reverse proxy settings
# [1] xhr request: http://localhost:8080/api/xxx/yyy/zzz
# [2] /api/xxx/yyy/zzz
# [3] http://your-dev-server.example.com/api/xxx/yyy/zzz
@uupaa
uupaa / Audio.WebAudio.Browser.Compat.md
Last active December 7, 2022 08:40
Audio, WebAudio, Blob, ArrayBuffer
  1. Audio(url)
  2. Audio(arraybuffer)
  3. Audio(blob)
  4. WebAudio(arraybuffer)
  5. WebAudio(blob)

Audio file access with streaming

http://uupaa.net/issues/3/ の結果

@uupaa
uupaa / image.onload.error.md
Last active September 28, 2022 09:49
image.onload.error

「ブラウザで画像を先読みしたい、簡単な方法はないか?」と聞かれたら、
(new Image()).src = URL; がお勧めです。

この一行で、ブラウザに画像をキャッシュさせる事ができます。

ただ、ブラウザに任せっきりではなく、細かくハンドリングしたい場合もあります。
このエントリはそのような場合に、どういった情報が利用できるかのメモです。

テストコード

@uupaa
uupaa / Wowza.md
Last active September 20, 2022 11:23
Wowza

Wowza

Wowza Media System 社の動画ストリーミングサーバ。有料。
コンテナは RTMP, RTP, MPEG-TS, HLS, HDS, MSS, DASH をサポート。コーデックは、H.264, H.265, AAC をサポートしています。

Document

Document

Free trial

@uupaa
uupaa / Mac VSCode: How to plantUML preview within markdown.md
Last active August 25, 2022 05:53
Mac VSCode: How to plantUML preview within markdown

Mac VSCode: How to plantUML preview within markdown.

Prepare

$ mkdir -p ~/java
$ cd ~/java
$ brew install maven
$ git clone https://github.com/plantuml/plantuml-server.git
$ cd plantuml-server