A interactive & generative site with canvas-sketch and Tone.js.
Live Demo:
A interactive & generative site with canvas-sketch and Tone.js.
Live Demo:
| [profile] | |
| layer_height = 0.2 | |
| wall_thickness = 1.6 | |
| retraction_enable = True | |
| solid_layer_thickness = 1.6 | |
| fill_density = 20 | |
| nozzle_size = 0.4 | |
| print_speed = 30 | |
| print_temperature = 200 | |
| print_temperature2 = 0 |
| module.exports = { | |
| config: { | |
| // default font size in pixels for all tabs | |
| fontSize: 12, | |
| // font family with optional fallbacks | |
| fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', | |
| // terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
| cursorColor: 'rgba(248,28,229,0.8)', |
| function parse(query) { | |
| const allpairs = query.split("&"); | |
| const out = {}; | |
| for (let i = 0; i < allpairs.length; i++) { | |
| let pair = allpairs[i].split("="); | |
| let key = pair[0]; | |
| let val = pair[1]; | |
| out[key] = val; | |
| } | |
| return out; |
Pode-se afirmar que no momento Promises são a forma mais "padrão" no momento de se tratar com
assincronismo no JS. Para quem trabalha com javascript, conhecê-las é essencial.
Uma dificuldade comum é que esta API tem uma curva de aprendizado um tanto acentuada de início, especialmente
se comparado com as alternativas mais antigas: callbacks e o módulo async. No meu caso, levei ao menos uns 3
meses pra "cair a ficha".
-- na verdade promises ainda são um remendo para o problema do assincronismo do JS. Elas ainda possuem certa dificuldade
| // Run from the dev tools console of any Youtube video | |
| // Accurate as of June 12, 2016 | |
| var videoUrls = {}; | |
| ytplayer.config.args.url_encoded_fmt_stream_map.split(',').forEach(function (item) { | |
| var obj = {}; | |
| item.split('&').forEach(function (param) { | |
| param = param.split('='); | |
| obj[param[0]] = decodeURIComponent(param[1]); | |
| }); |
| // Run from the dev tools console of any Youtube video | |
| // Accurate as of July 2, 2020. | |
| // | |
| // Copy and paste this into the dev console in a browser with the desired video loaded. | |
| // | |
| // NOTE: Some Youtube videos do not directly expose the video url in the response. | |
| // This script doesn't currently attempt to handle those. It will work for most other general video types though. | |
| (async () => { | |
| const html = await fetch(window.location.href).then((resp) => resp.text()).then((text) => text); |