Skip to content

Instantly share code, notes, and snippets.

Twitter abuses all media file uploads, each type in its own way. If we want to upload a good looking animation loop from some low-color, high-detail generative art, we have to game their system's mechanisms.

  • don't upload a video file, they will re-encode it into absolute 💩

  • create a GIF, which they will auto-convert into a video file 😱

  • The frames of the GIF will be resized to an even-sized width using an extremely naive algorithm. Your GIF should be an even size (1000, 2000,

Fixing macOS 10.14, 10.15, 12

Dark main menu without the rest of dark mode

  1. Set Light mode
  2. defaults write -g NSRequiresAquaSystemAppearance -bool Yes
  3. Log out and log back in
  4. Set Dark mode
@jasonlong
jasonlong / example-sparkline.md
Last active May 14, 2018 02:36
Example for generating SVG sparklines – Released under CC0-1.0 (https://creativecommons.org/publicdomain/zero/1.0/)

example-sparkline

@eeropic
eeropic / Ae expressions and scripts.js
Last active March 23, 2024 22:00
After effects expressions and scripts collected from various authors and myself.
//dynamic parenting for 3d layers
//from Dan Ebberts on forums I think..
//Position
L=thisComp.layer("Object center");
L.toWorld(L.effect(name)("3D Point"));
//Scale
L =thisComp.layer("Object center");
[L.transform.scale[0]/100*value[0],L.transform.scale[1]/100*value[1],L.transform.scale[2]/100*value[2]];
@EricTRocks
EricTRocks / Maya_InvertShapeWeights.py
Created September 20, 2016 03:43
Invert BlendShape weights
from maya import cmds
import pymel.core as pm
sel = pm.ls(selection=True)
print sel[0]
blends = sel[0].getShape().inputs(type='blendShape')
if len(blends) < 1:
print "No blend shapes on this node!"
else:
@andymatuschak
andymatuschak / States-v3.md
Last active May 1, 2024 12:32
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

/*
----------------------
MirrorMe 1.1.2 (by Ced)
----------------------
nicolasced@yahoo.fr
http://grain.s.free.fr
----------------------
thanks to ## Haider Alghifary ## for feddback and improvements ideas...:)
@watson
watson / cheatsheet.md
Created October 5, 2014 23:34
ffmpeg cheat sheet

Convert A -> B

Convert and transcode:

ffmpeg -i in.mkv out.mp4

Covert without transcoding:

@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

on open theFiles
repeat with aFile in theFiles
if application "Adobe Photoshop CC" is running then
tell application "Adobe Photoshop CC"
open aFile
activate
end tell
else
tell application "Preview" to open aFile
end if