Skip to content

Instantly share code, notes, and snippets.

@plugn
plugn / index.html
Created February 29, 2024 16:19
JointJS: Shapes Drawing
<div id="paper-container"></div>
<div id="tools">
<input type="radio" name="tools" id="Pointer">
<label for="Pointer">Pointer</label>
<input type="radio" name="tools" id="Line">
<label for="Line">Line</label>
<input type="radio" name="tools" id="Rectangle" checked>
<label for="Rectangle">Rectangle</label>
<input type="radio" name="tools" id="Ellipse">
@plugn
plugn / jointjs-comment-mode.markdown
Last active February 14, 2024 09:19
JointJS: Comment Mode

JointJS: Comment Mode

Do you want to enable a special mode where users can only post comments? They could only insert or delete comments, but not interfere with the structure of the diagram. Take a look at this code pen.

A Pen by Max Dolgov on CodePen.

License.

@plugn
plugn / PreventGhostClick.js
Created January 17, 2024 21:55 — forked from jtangelder/PreventGhostClick.js
PreventGhostClick
/**
* Prevent click events after a touchend.
*
* Inspired/copy-paste from this article of Google by Ryan Fioravanti
* https://developers.google.com/mobile/articles/fast_buttons#ghost
*
* USAGE:
* Prevent the click event for an certain element
* ````
* PreventGhostClick(myElement);
@plugn
plugn / .block
Created January 9, 2024 17:00 — forked from mbostock/.block
Line Drawing
license: gpl-3.0
redirect: https://observablehq.com/@d3/draw-me
@plugn
plugn / sketch.html
Created January 9, 2024 15:16 — forked from tomhodgins/sketch.html
Draw <svg> inside the browser! On mousedown and touchstart it begins drawing a line, drops nodes as you mousemove or touchmove, and then finishes the line where you mouseup or touchend. It also has support for line width and color, exporting the current drawing by email as well as downloading the drawing as an svg file.You can also import SVGs. h…
<!DOCTYPE html>
<html manifest=sketch.manifest>
<head>
<meta charset=utf-8>
<title>Sketch</title>
<meta name=apple-mobile-web-app-capable content=yes>
<meta name=apple-mobile-web-app-status-bar-style content=black>
<meta name=viewport content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, minimal-ui">
<link href="http://staticresource.com/formal.css" rel=stylesheet type=text/css>
<script>eval(unescape(escape('♶♡♲☠♩☽♤♯♣♵♭♥♮♴☮♣♲♥♡♴♥♅♬♥♭♥♮♴☨☧♣♡♮♶♡♳☧☩☬♣☽♩☮♧♥♴♃♯♮♴♥♸♴☨☧☲♤☧☩☬♦☽♤♯♣♵♭♥♮♴☮♣♲♥♡♴♥♅♬♥♭♥♮♴☨☧♬♩♮♫☧☩☬♭☽♤♯♣♵♭♥♮♴☮♣♲♥♡♴♥♅♬♥♭♥♮♴☨☧♬♩♮♫☧☩☻♩☮♷♩♤♴♨☽☲☰☰☻♩☮♨♥♩♧♨♴☽☲☰☰☻♣☮♦♩♬♬♓♴♹♬♥☽☧♬♩♧♨♴♧♯♬♤♥♮♲♯♤♹♥♬♬♯♷☧☻♣☮♢♥♧♩♮♐♡♴♨☨☩☻♣☮♭♯♶♥♔♯☨☱☰☬☰☩☻♣☮♬♩♮♥♔♯☨☱☹☰☬☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☲☰☰☬☰☬☲☰☰☬☱☰☩☻♣☮♬♩♮♥♔♯☨☲☰☰☬☱☹☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☲☰☰☬☲☰☰☬☱☹☰☬☲☰☰☩☻♣☮♬♩♮♥♔♯☨☱☰☬☲☰☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☰☬☲☰☰☬☰☬☱☹☰☩☻♣☮♬♩♮♥♔♯☨☰☬☱☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☰☬☰☬☱☰☬☰☩☻♣☮♣♬♯♳♥♐♡♴♨☨☩☻♣☮♦♩♬♬☨☩☻♣☮♳♴♲♯♫♥♓♴♹♬♥☽☧♲♥♤☧☻♣☮♬♩♮♥♗♩♤♴♨☽☳☰☻♣☮♬♩♮♥♃♡♰☽☧♲♯♵♮♤☧☻♣☮♢♥♧♩♮♐♡♴♨☨☩☻♣☮♭♯♶♥♔♯☨☴☵☬☱☳☰☩☻♣☮♢♥♺♩♥♲♃♵♲♶♥♔♯☨☴☵☬☱☳☰☬☷☰☬☲☰☰☬☱☰☵☬☱☳☰☩☻♣☮♢♥♺♩♥♲♃♵♲♶♥♔♯☨☱☰☵☬☱☳☰☬☱☴☰☬☵☰☬
@plugn
plugn / index.html
Created October 31, 2023 00:56
RPL chart 20231030
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/series-label.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<figure class="highcharts-figure">
<div id="container"></div>
<p class="highcharts-description">
Basic line chart showing trends in a dataset. This chart includes the
function walkObjectRecursive(source, mapper = (v, k) => ({ [k]: v })) {
if (typeof source !== 'object' || source === null || source === undefined) {
return source
}
if (Array.isArray(source)) {
return source.reduce((acc, val, index) => [...acc, mapper(walkObjectRecursive(val, mapper), index)], [])
}
return Object.keys(source).reduce(

List available programs

$ ffmpeg -i <URL.m3u8>

Specifying program

$ ffmpeg -i URL.m3u8 -map <SOURCE_IDX>:p:<PROGRAM_NUMBER> -c copy output.ext
@plugn
plugn / m3u8-to-mp4.md
Created June 3, 2023 11:32 — forked from tzmartin/m3u8-to-mp4.md
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@plugn
plugn / remove-docker-on-mac.sh
Last active May 11, 2023 12:10
remove-docker-on-mac.sh
# https://nsikakimoh.com/blog/remove-docker-completely-from-mac
sudo rm -rf ~/.docker
sudo rm -rf ~/Library/Containers/com.docker.docker
sudo rm -rf ~/Library/Group\ Containers/group.com.docker
sudo rm -rf ~/Library/Caches/com.docker.docker
sudo rm -rf /Library/PrivilegedHelperTools/com.docker.vmnetd
sudo rm -rf /Library/LaunchDaemons/com.docker.vmnetd.plist
sudo rm -rf /usr/local/lib/docker
sudo rm -rf ~/Library/Application Support/Docker Desktop