Skip to content

Instantly share code, notes, and snippets.

View maximilliangeorge's full-sized avatar

Maximillian George maximilliangeorge

  • Will and Max
  • Stockholm
View GitHub Profile
@maximilliangeorge
maximilliangeorge / scrollPipe.js
Last active January 8, 2026 16:16
Utility to scroll through a website for demonstration purposes
// Cubic Bezier utility (from CSS spec)
function cubicBezier(p1x, p1y, p2x, p2y) {
const cx = 3 * p1x
const bx = 3 * (p2x - p1x) - cx
const ax = 1 - cx - bx
const cy = 3 * p1y
const by = 3 * (p2y - p1y) - cy
const ay = 1 - cy - by
@maximilliangeorge
maximilliangeorge / index.js
Last active July 8, 2023 04:04 — forked from Tynael/README.md
How to use npx to run gist based scripts
#!/usr/bin/env node
console.log("I was executed from a gist inside the terminal with npx!");
@maximilliangeorge
maximilliangeorge / index.js
Last active July 8, 2023 04:14
How to use npx to run gist based scripts
#!/usr/bin/env node
console.log("I was executed from a gist inside the terminal with npx!");
@maximilliangeorge
maximilliangeorge / sizing.scss
Last active May 15, 2025 07:35
SCSS size interpolation
// strip unit utility function
@function strip-unit($n) {
@return math.div($n, ($n * 0 + 1));
}
/**
* @function scale-between
* interpolates the size of an element based on the size of the screen
*
@maximilliangeorge
maximilliangeorge / carousel.js
Last active November 18, 2024 11:34
Pure function carousel wrap
@maximilliangeorge
maximilliangeorge / marker-sync.js
Last active April 9, 2020 15:04 — forked from animoplex/MarkerSyncExpression.jsx
Marker Sync - After Effects Expression by Animoplex
// MARKER SYNC
//
// Allows you to trigger playback of precomp segments using markers.
// This allows you to change timings without diving into precomps and makes it easier to reason about your project file.
//
// 1. Create a precomp A with a layer called "Controller"
// 2. Add named markers to the timeline within Controller.
// 3. In the parent comp, enable Time Remapping for the precomp A
//
// Modified expression based on Dan Ebbert's Marker Sync Expression
@maximilliangeorge
maximilliangeorge / countdown.js
Last active April 9, 2020 15:05
AE Countdown
// COUNTDOWN
//
// Creates a countdown in the following format:
// 00D:00H:00M:00S
//
// 1. Create text layer
// 2. Apply expression to text property.
rate = -1;
clockStart = 930604.999;
@maximilliangeorge
maximilliangeorge / scrolling.js
Last active April 9, 2020 15:07
After Effects Expressions
// MOMENTUM SCROLLING
//
// Nice easings without the hassle. Doesn't work well for very long distances.
//
// 1. Separate dimensions on layer to scroll (right click _> separate dimensions)
// 2. Apply the expression to the layers Y Position
// 3. Add keyframes. Easing will adapt to mimic momentum scrolling.
const c = thisLayer("Transform")("Y Position")
@maximilliangeorge
maximilliangeorge / functions.php
Created October 31, 2018 14:14
Add ACF custom fields to the Wordpress JSON API
<?php
// Add ACF data to the WP JSON REST API
add_action('rest_api_init', 'create_api_posts_meta_field');
function create_api_posts_meta_field() {
function get_acf($post) {
@maximilliangeorge
maximilliangeorge / images.json
Created October 1, 2018 20:05
DigitalOcean Images 2018
{
"images": [{
"id": 38123186,
"name": "1883.1.0 (beta)",
"distribution": "CoreOS",
"slug": "coreos-beta",
"public": true,
"regions": ["nyc1", "sfo1", "nyc2", "ams2", "sgp1", "lon1", "nyc3", "ams3", "fra1", "tor1", "sfo2", "blr1"],
"created_at": "2018-09-11T22:47:44Z",
"min_disk_size": 20,