This file contains hidden or 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(url, inj) { | |
inj(url).then(function() { | |
if (annyang) { | |
// Let's define a command. | |
var commands = { | |
'hello': function() { alert('Hello world!'); } | |
}; | |
// Add our commands to annyang |
This file contains hidden or 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(url, inj) { | |
inj(url).then(function() { | |
html2canvas(document.body).then(function(canvas) { | |
document.body.appendChild(canvas); | |
}); | |
}) | |
})('https://html2canvas.hertzen.com/dist/html2canvas.min.js', (src, head = true) => new Promise(function(c, d) { |
This file contains hidden or 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(a){var b=a.createElement("button");b.innerText="Screencap";b.onclick=function(){var d=a.querySelector("video"),e=a.createElement("canvas"),b=e.getContext("2d"),c=a.createElement("a");e.width=d.videoWidth;e.height=d.videoHeight;b.drawImage(d,0,0);c.download=[ytcsi.data_.info.docid,d.currentTime,".png"].join("-");c.href=e.toDataURL();a.body.appendChild(c);c.click();a.body.removeChild(c)};a.querySelector("h1.title").appendChild(b)})(document); |
This file contains hidden or 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 AudioContext = window.AudioContext || window.webkitAudioContext; | |
var audioContext = new AudioContext(); | |
var synthDelay = audioContext.createDelay(0.2); | |
synthDelay.connect(audioContext.destination) | |
// request audio stream from the user's webcam | |
navigator.mediaDevices.getUserMedia({ | |
audio: true | |
}) | |
.then(function (stream) { |
This file contains hidden or 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(style, func){ | |
document.addEventListener('sentinel-load', function(){ | |
sentinel.on(style, func); | |
}) | |
var a=document.createElement("script");a.src='//cdn.rawgit.com/muicss/sentineljs/0.0.4/dist/sentinel.min.js';a.type="text/javascript"; | |
document.head.appendChild(a); | |
})('.my-div', function(el) { | |
el.innerHTML = 'The sentinel is always watching.'; | |
}) |
This file contains hidden or 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
let tokens = []; | |
let dsl = new Proxy({}, { | |
get(state, token) { | |
// Before anything, we're going to try and access a variable | |
if (tokens.length === 0 && state[token] !== undefined) { | |
return state[token]; | |
} | |
tokens.push(token); | |
const rule = grammar[tokens[0]]; |
This file contains hidden or 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(url1, url2, url3, inj) { | |
inj(url1).then(() => inj(url2)).then(() => inj(url3)).then(async function() { | |
var canvas = document.createElement('canvas') | |
var ctx = canvas.getContext('2d'); | |
const net = await posenet.load(); | |
var processfn = async function(video, dt) { | |
ctx.drawImage(video, 0, 0); |
This file contains hidden or 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(){var urls = Array.from(arguments), inj = urls.pop();Promise.all(urls.map(inj)).then(function(){ | |
var initialized = false; | |
var canvas = document.createElement('canvas') | |
document.body.appendChild(canvas) | |
var button = document.createElement('button') |
This file contains hidden or 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 lines(elem, limit = 3, delimiter = ' '){ | |
const width = elem.clientWidth | |
const words = elem.innerText.split(delimiter) | |
const ctx = document.createElement('canvas').getContext('2d'), | |
fnt = window.getComputedStyle(elem).getPropertyValue('font') | |
ctx.font = fnt |
This file contains hidden or 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(inj){ | |
inj('https://unpkg.com/react@16/umd/react.development.js').then(()=>inj('https://unpkg.com/react-dom@16/umd/react-dom.development.js')).then(()=>inj('https://unpkg.com/[email protected]/babel.min.js')).then(function(){ | |
var out=document.createElement("div");out.id='testing'; | |
document.body.appendChild(out) | |
console.log('loaded babel') | |
Babel.registerPlugin('eval_wrapper', function eval_wrapper() { return {visitor: { | |
FunctionDeclaration(path) { | |
console.log('a func') | |
// debugger | |
}, |