Skip to content

Instantly share code, notes, and snippets.

@hhyyg
hhyyg / index.html
Created Dec 2, 2021
Web Audio API. This code works in Chrome 96 but not in Safari 15.1
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8>
<title></title>
</head>
<body>
<button id="start-button">start</button>
View rxjs-tips.md
@hhyyg
hhyyg / test.ts
Created Aug 8, 2021
Jasmine tests
View test.ts
const somethingPromise = (ms) =>
new Promise((resolve) => setTimeout(resolve, ms));
const somethingErrorPromise = (ms) =>
new Promise((resolve) => {
throw new Error();
});
describe("test", () => {
it("test", async (done) => {
@hhyyg
hhyyg / okusuritecho.json
Last active Apr 30, 2021
https://www.jahis.jp/standard/detail/id=665 の一部の仕様を JSON で表したものですが、必ずしも仕様に準拠したものではありません。
View okusuritecho.json
{
"1": {
"0": {
"title": "患者情報レコード"
},
"1": {
"title": "患者氏名"
},
"2": {
"title": "患者性別"
View circle-drum.md
.....................
............4C4......
..........1.404TFFFD.
..U..E...E..:02F.....
.......1D4...........
...N.51X...H.........
...........S.........
...........j.........
.....................
View note.orca
...................
.1D4.C.......C5....
....A62......1.....
..:18A.......J.....
.............1.....
..........C4.J.....
..........2Y21.....
............JJ.....
...........F21.....
............:11Aa..
View magical.js
const synth = new Tone.Synth().toMaster();
const polySynth = new Tone.PolySynth(6, Tone.Synth).toMaster();
polySynth.volume.value = -5;
Tone.Transport.bpm.value = 90;
const chordAb = ["Ab3", "Cb4", "Eb4", "Gb4"];
const chordDb = ["Ab3", "Cb4", "Db4", "F4"];
const chordEb = ["Gb3", "Bb3", "Db4"];
@hhyyg
hhyyg / spread-operator.ts
Last active Feb 15, 2019
TypeScript: Spread Operator(Object spread, Destructuring)
View spread-operator.ts
interface PersonA {
name: string,
group: string,
item1: string,
item2: string,
}
interface PersonB {
name: string,
@hhyyg
hhyyg / object.assign.ts
Last active Feb 13, 2019
Object.assign(), Spread_syntax, Index Signatures
View object.assign.ts
interface Foo {
readonly bar: number;
readonly baz: number;
}
const fooArray: Foo[] = [
{ bar: 100, baz: 200 },
{ bar: 300, baz: 400 },
]