Skip to content

Instantly share code, notes, and snippets.

View Narigo's full-sized avatar

Joern Bernhardt Narigo

View GitHub Profile
@Narigo
Narigo / figma-underdog-plugins.sh
Last active January 22, 2021 19:31
Find #Figma plugins with a high like-to-install ratio
# find #Figma plugin underdogs
curl https://raw.githubusercontent.com/yuanqing/figma-plugins-stats/gh-pages/index.json > d.json
node <<'EOF'|head -n 50
let d = require("./d.json");
let r = (p) => p.likeCount / p.installCount;
d.plugins
.sort((a, b) => r(b) - r(a))
.forEach((p, i) => console.log(`${i + 1}. ${p.name} by ${p.publisherName}`));
EOF
@Narigo
Narigo / mediarecorder.js
Created February 4, 2022 00:55
Poor man's recorder - to be used in browsers dev tools; start with recorder.record(); and stop with recorder.stop();
let recorder = await navigator.mediaDevices
.getUserMedia({ audio: true })
.then((mediaSourceObject) => {
document.createElement("audio").srcObject = mediaSourceObject;
const recorder = new MediaRecorder(mediaSourceObject);
let data = [];
recorder.ondataavailable = (e) => data.push(e.data);
recorder.onstop = () => {
const blob = new Blob(data, { type: "audio/ogg" });
data = [];