Skip to content

Instantly share code, notes, and snippets.

@hrwgc
hrwgc / README.md
Last active September 4, 2023 11:15
VIIRS Nighttime Lights 2012 processing
@TomByrne
TomByrne / MultiExporter.jsx
Last active May 24, 2024 15:18
An Illustrator script for exporting layers and/or artboards into separate files (PNG8 / PNG24 / EPS / PDF / SVG / JPG / FXG).See http://www.tbyrne.org/export-illustrator-layers-to-svg-files
// MultiExporter.jsx
// Version 0.1
// Version 0.2 Adds PNG and EPS exports
// Version 0.3 Adds support for exporting at different resolutions
// Version 0.4 Adds support for SVG, changed EPS behaviour to minimise output filesize
// Version 0.5 Fixed cropping issues
// Version 0.6 Added inner padding mode to prevent circular bounds clipping
//
// Copyright 2013 Tom Byrne
// Comments or suggestions to tom@tbyrne.org
@themiurgo
themiurgo / merge-geojsons.py
Last active September 11, 2022 12:41 — forked from migurski/merge-geojsons.py
Merge two or more geojson files.
#!/usr/bin/env python
from json import load, JSONEncoder
from argparse import ArgumentParser, FileType
from re import compile
import sys
float_pat = compile(r'^-?\d+\.\d+(e-?\d+)?$')
charfloat_pat = compile(r'^[\[,\,]-?\d+\.\d+(e-?\d+)?$')
@thatsmadden
thatsmadden / null-between-nulls
Last active September 5, 2022 01:14
Place an After Effects Null between two other Nulls and drive that placement with a slider. Goes in the Position property of a layer.
a=thisComp.layer("NullA").toWorld([0,0,0]);
b=thisComp.layer("NullB").toWorld([0,0,0]);
wh=thisLayer.effect("weight")("Slider");
aW=a*wh;
bW=b*(1-wh);
aW+bW
@thatsmadden
thatsmadden / around-a-circle
Last active September 5, 2022 01:14
Send an After Effects layer around a circle.
s=effect("size")("Slider");
d=degreesToRadians(effect("driver")("Angle"));
h=Math.sin(d);
v=-Math.cos(d);
([h,v]*s)+value
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active June 9, 2024 21:23
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@animoplex
animoplex / EvaluateTextLayer.jsx
Last active August 22, 2022 11:09
Evaluate Text Layer - After Effects Expression by Animoplex
// Evaluate Text Layer - Created by Animoplex: www.animoplex.com
// Read and execute an expression from a text layer in After Effects.
// Note: Evaluated quotation marks must be straight quotes, not curly quotes.
// Full Tutorial: https://www.youtube.com/watch?v=Wkr_XOpsAFU&t=19s
eval(thisComp.layer("Text Layer 1").text.sourceText.value);
@animoplex
animoplex / InertialBounce.jsx
Last active January 24, 2024 16:35
Inertial Bounce - After Effects Expression by Animoplex
// Inertial Bounce - Created by Animoplex: www.animoplex.com
// Original Version: http://www.graymachine.com/top-5-effects-expressions/
// Modified expression for a smoother bounce effect and easier editing. Use this on any property with two keyframes to get a nice bounce effect that is based on velocity of the value change. Perfect for a scale from 0 to 100 or a speedy rotation that needs some extra life. Adjust amp, freq and decay values to tweak the effect. Amp is intensity, freq is bounces per second, and decay is the speed of decay, slow to fast.
// Full Tutorial: https://www.youtube.com/watch?v=653lxeVIyoo
amp = 5.0; freq = 2.0; decay = 4.0;
n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
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);
@beesandbombs
beesandbombs / bloom.pde
Created May 24, 2017 23:33
blooming dodecahedron
// by david whyte :)
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {