This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2022 Mathias Panzenböck | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { | |
function screenshot(video) { | |
var canvas = document.createElement('canvas'); | |
canvas.width = video.videoWidth; | |
canvas.height = video.videoHeight; | |
context = canvas.getContext('2d'); | |
var now = new Date(); | |
context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight); | |
var url = canvas.toDataURL('image/png'); | |
var link = document.createElement('a'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
set -eo pipefail | |
RED=$(echo -e '\033[0;1;31m') | |
NORMAL=$(echo -e '\033[0m') | |
if [[ $# -lt 1 ]]; then | |
echo "usage: $0 <logfile> [jq-options...]">&2 | |
exit 1 | |
fi | |
logfile=$1 | |
shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <complex.h> | |
#define dc double complex | |
dc | |
Y(dc | |
V, | |
dc B,dc c){ | |
return | |
(cabs (V)<6)?(c?Y(V *V+ | |
B,B,c-1):c):(2+c-4*cpow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; | |
window.saveAs = window.saveAs || window.webkitSaveAs || window.mozSaveAs || window.msSaveAs; | |
function saveCanvas (canvas, filename, fileformat) { | |
if (navigator.msSaveBlob || window.URL || window.saveAs) { | |
if (canvas.toBlob) { | |
canvas.toBlob(function (blob) { | |
saveBlob(blob, filename); | |
}, fileformat); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(()=>{var d=document.documentElement,b=document.body,es=b.querySelectorAll("*"),m=20;for(var i=0;i<es.length;++i){var e=es[i];var s=getComputedStyle(e);if(s.position!=='static'&&s.position!=='relative'){var r=e.getBoundingClientRect();if(r.x<=m&&r.y<=m&&r.right>=window.innerWidth - m&&r.bottom>=window.innerHeight - m){e.remove();}}}var s='\n/**/;position:static!important;overflow:auto!important;width:auto!important;height:auto!important;';d.setAttribute('style',(d.getAttribute('style')||'')+ s);b.setAttribute('style',(b.getAttribute('style')||'')+ s);})();void(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (BrowserSupportedMimeTypes[mimetype.split(";")[0]] === true) { | |
mimetype = "application/octet-stream"; | |
} | |
blob = builder.getBlob(mimetype); | |
url = URL.createObjectURL(blob); | |
window.open(url, '_blank', ''); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var cursor=document.body.style.cursor;var overlay=document.createElement('div');var iframeCatch=document.createElement('div');var style='border:1px solid #3280FF;background-color:rgba(50,128,255,0.5);position:absolute;z-index:2147483647;display:block;box-sizing:border-box;left:0;top:0;width:0;height:0;margin:0;padding:0;';var ev='pointer-events:none;';var tr='transition:width 60ms,height 60ms,left 60ms,top 60ms;';var br='border-radius:0;';style +=ev+'-webkit-'+ev+'-moz-'+ev;style +=tr+'-webkit-'+tr+'-moz-'+tr;style +=br+'-webkit-'+br+'-moz-'+br;overlay.setAttribute('style',style);document.body.appendChild(overlay);style='border:none;position:absolute;z-index:2147483647;display:none;box-sizing:border-box;left:0;top:0;width:0;height:0;margin:0;padding:0;';style +=br+'-webkit-'+br+'-moz-'+br;iframeCatch.setAttribute('style',style);iframeCatch.addEventListener('mouseout',function(event){this.style.display='none';},false);document.body.appendChild(iframeCatch);document.body.style.cursor="cro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function supportsSVG() { | |
return !!document.createElementNS && !!document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect; | |
} |