Skip to content

Instantly share code, notes, and snippets.

View rvillas's full-sized avatar

rvillas rvillas

View GitHub Profile
@rvillas
rvillas / README.md
Created January 15, 2020 21:37 — forked from dbuezas/README.md
Pie charts labels

This variation of a donut chart demonstrates how to add labels with lines. Clicking on the button changes the displayed data. Check Pie Chart with Labels and Missing Data to see how to handle transitions with missing/new data.

@rvillas
rvillas / background.js
Created July 8, 2021 18:23 — forked from muralikg/background.js
puppeteer screen capture demo. Currently records 10 second video. Change the timeout in background.js with your own logic to stop the recording when necessary. Try with `node export.js`
/* global chrome, MediaRecorder, FileReader */
chrome.runtime.onConnect.addListener(port => {
let recorder = null
port.onMessage.addListener(msg => {
console.log(msg);
switch (msg.type) {
case 'REC_STOP':
console.log('Stopping recording')
if (!port.recorderPlaying || !recorder) {
@rvillas
rvillas / hexes.pde
Created August 24, 2022 22:26 — forked from beesandbombs/hexes.pde
hexes
// by dave @beesandbombs
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@rvillas
rvillas / cubes.pde
Created August 24, 2022 22:40 — forked from beesandbombs/cubes.pde
cube / cubes
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
@rvillas
rvillas / shiftinSquares.pde
Created August 24, 2022 22:47 — forked from beesandbombs/shiftinSquares.pde
shiftin’ squares
// by dave @beesandbombs
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {