Skip to content

Instantly share code, notes, and snippets.

@munrocket
munrocket / shadertoy_exporter.js
Last active November 14, 2023 18:51
How to record cycled video from shadertoy
// copy paste this in console
function shader_exporter(duration, width, heigth, paused) {
document.getElementById('demogl').style.width = width + 'px';
document.getElementById('demogl').style.height = heigth + 'px';
document.getElementById('myResetButton').click();
document.getElementById('myRecord').click();
if (paused) document.getElementById('myPauseButton').click();
let t0 = performance.now();
function loop(){
if (performance.now() - t0 > duration * 1000) {
@LeoHuckvale
LeoHuckvale / gist:89683dc242f871c8e69b
Created February 2, 2015 16:53
matplotlib - Add subplots dynamically
@bsweger
bsweger / useful_pandas_snippets.md
Last active March 20, 2024 21:09
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

Given J*JT * x = b, solve for x in linear time and space.
J is m by n
x is m by 1
b is m by 1
m < n
J is a rectangular matrix that represents a tree with equal and opposite entries.
For example: