View rects.js
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
const src = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAAHCAAAAABmCOEJAAAACXBIWXMAAAsTAAALEwEAmpwYAAADGGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjaY2BgnuDo4uTKJMDAUFBUUuQe5BgZERmlwH6egY2BmYGBgYGBITG5uMAxIMCHgYGBIS8/L5UBFTAyMHy7xsDIwMDAcFnX0cXJlYE0wJpcUFTCwMBwgIGBwSgltTiZgYHhCwMDQ3p5SUEJAwNjDAMDg0hSdkEJAwNjAQMDg0h2SJAzAwNjCwMDE09JakUJAwMDg3N+QWVRZnpGiYKhpaWlgmNKflKqQnBlcUlqbrGCZ15yflFBflFiSWoKAwMD1A4GBgYGXpf8EgX3xMw8BSMDVQYqg4jIKAUICxE+CDEESC4tKoMHJQODAIMCgwGDA0MAQyJDPcMChqMMbxjFGV0YSxlXMN5jEmMKYprAdIFZmDmSeSHzGxZLlg6WW6x6rK2s99gs2aaxfWMPZ9/NocTRxfGFM5HzApcj1xZuTe4FPFI8U3mFeCfxCfNN45fhXyygI7BD0FXwilCq0A/hXhEVkb2i4aJfxCaJG4lfkaiQlJM8JpUvLS19QqZMVl32llyfvIv8H4WtioVKekpvldeqFKiaqP5UO6jepRGqqaT5QeuA9iSdVF0rPUG9V/pHDBYY1hrFGNuayJsym740u2C+02KJ5QSrOutcmzjbQDtXe2sHY0cdJzVnJRcFV3k3BXdlD3VPXS8Tbxsfd99gvwT//ID6wIlBS4N3hVwMfRnOFCEXaRUVEV0RMzN2T9yDBLZE3aSw5IaUNak30zkyLDIzs+ZmX8xlz7PPryjYVPiuWLskq3RV2ZsK/cqSql01jLVedVPrHzbqNdU0n22VaytsP9op3VXUfbpXta+x/+5Em0mzJ/+dGj/t8AyNmf2zvs9JmHt6vvmCpYtEFrcu+bYsc/m9lSGrTq9xWbtvveW |
View MediaRecoder.js
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 r() { | |
let mediaRecorder; | |
let recordedBlobs; | |
let startTime = 0; | |
function handleDataAvailable(event) { | |
console.log('on data available') | |
if (event.data && event.data.size > 0) { | |
recordedBlobs.push(event.data); |
View gist:614f8611b8eb080394242a2f0f69cd69
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
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> | |
<style> | |
.Easter { | |
egg: #17; | |
} | |
html, body { | |
background:#cccccc url(/wallpapers/cn.jpg) repeat left top; | |
background-size: 100%; | |
font: normal 12px tahoma, arial, verdana, sans-serif; | |
margin: 0; |
View gist:12e458ea49be527e0691ed32bdc6d2b9
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
canvas.toBlob( e => { | |
const url = URL.createObjectURL(e); | |
const link = document.createElement('a'); | |
link.setAttribute('href',url); | |
link.setAttribute('download','image.webp'); | |
link.click(); | |
console.log(url);}, | |
'image/webp', |
View Google Images
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
document.body.addEventListener('click', async e => { | |
if(e.srcElement && e.srcElement.classList.contains('irc_mi')) { | |
const downloadBtn = document.createElement( 'a' ); | |
downloadBtn.setAttribute( 'target', '_blank' ); | |
downloadBtn.setAttribute( 'href', e.srcElement.src ); | |
downloadBtn.click(); | |
e.preventDefault(); |
View Grid
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 Block( x, y, w, h, d ) { | |
this.x = x; | |
this.y = y; | |
this.w = w; | |
this.h = h; | |
this.d = d; | |
this.children = []; |
View gist:90e3dbf8e117660f6788a5748ae06cad
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
document.getElementById( 'loading' ).style.display = 'none'; | |
var speed = .001; // changes the rate of rotation | |
var distance = 4; // changes the distance the point travels | |
function _update() { | |
bAmDrawing = true; | |
lastMouseX = 0; lastMouseY = 0; | |
var a = speed * performance.now(); | |
var x = distance * Math.cos( a ); | |
var y = distance * Math.sin( a ); | |
stage.mousemove( { data: { global : { x: x, y: y } } } ) |
View WebGL detection
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
var canvas = document.createElement( 'canvas' ); | |
!! ( window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ) ); |
View plotly-ccapture.html
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
<html> | |
<head> | |
<title>Page Title</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> | |
<script src="CCapture.all.min.js"> | |
</script> | |
</head> | |
<body> | |
<div id="elementToShare" class="elementToShare"> |
View gist:00b3f17734810168093eb92a12815df3
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
var geometry = new THREE.IcosahedronGeometry( 2, 5 ); | |
for ( var i = 0, l = geometry.faceVertexUvs[ 0 ].length; i < l; i ++ ) { | |
for ( var j = 0, jl = geometry.faceVertexUvs[ 0 ][ i ].length; j < jl; j ++ ) { | |
var uv = geometry.faceVertexUvs[ 0 ][ i ][ j ]; | |
var a = uv.y * Math.PI - Math.PI / 2; | |
a = Math.sin(a); |