josefandersson / download_video_element.js
0 gustos
0 bifurcaciones
1 archivos
Última actividad 9 months ago
| 1 | // Record a video element and download the recording. Workaround download method for blob videos that cannot be downloaded directly. |
| 2 | function dl(videoElement) { |
| 3 | let recordedChunks = []; |
| 4 | |
| 5 | const stream = videoElement.captureStream(); |
| 6 | |
| 7 | mediaRecorder = new MediaRecorder(stream, { mimeType: "video/mp4" }); |
| 8 | |
| 9 | mediaRecorder.ondataavailable = (event) => { |
| 10 | if (event.data.size > 0) { |
josefandersson / HexGrid
0 gustos
0 bifurcaciones
1 archivos
Última actividad 2 years ago
Fancy hex grid component by Mr Gabbeboi
| 1 | import { css } from "@linaria/core" |
| 2 | import type { CSSProperties, ReactNode } from "react" |
| 3 | import React from "react" |
| 4 | |
| 5 | /** width / heigt */ |
| 6 | const hexAspectRatio = 4 / 3 * Math.sqrt(3) / 2 |
| 7 | |
| 8 | export function HexGrid({ |
| 9 | gap, |
| 10 | rows, |
josefandersson / Ugly fizzbuzz
0 gustos
0 bifurcaciones
1 archivos
Última actividad 2 years ago
First code written after a 16 day vacation!!
| 1 | const fizzBuzz = (num=1) => num <= 100 && ( |
| 2 | console.log(((num % 3 === 0 ? 'fizz' : '') + (num % 5 === 0 ? 'buzz' : '')) || num) |
| 3 | || fizzBuzz(num + 1) |
| 4 | ) |
Siguiente
Anterior