Skip to content

Instantly share code, notes, and snippets.

View avadhbsd's full-sized avatar
💭
I may be slow to respond.

Avadh avadhbsd

💭
I may be slow to respond.
  • India
View GitHub Profile
@beesandbombs
beesandbombs / fourCones.pde
Created November 29, 2018 00:52
four cones
// "four cones" by dave :)
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@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]];
@MrNickBreen
MrNickBreen / swapLayersAndRepositionElements.coffee
Created October 1, 2016 00:40
Swap two Framer layers of different heights and reposition parent layers
# Swap two Framer layers of different heights and reposition parent layers
# Special thanks to Niels http://stackoverflow.com/questions/39240373/framerjs-layer-with-dynamic-height-importing-layers-from-sketch (much cleaner than the original solution I wrote)
# Cowritten by Emily (https://github.com/xymostech) & Nick (https://github.com/mrnickbreen) at Khan Academy (https://github.com/khan)
stackLayers = (layerList, amountToReposition = 0) ->
for layer in layerList
layer.y = layer.y + amountToReposition
resizeParents = (layer, heightDifference) ->
if !layer.parent
return
@nicoptere
nicoptere / convert.jsx
Last active December 19, 2023 13:39
converts after effects layers' keyframes to JSON and saves file on hard drive.
//JSON object
"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(t){return 10>t?"0"+t:t}function this_value(){return this.valueOf()}function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var r,n,o,u,f,a=gap,i=e[t];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(t)),"function"==typeof rep&&(i=rep.call(e,t,i)),typeof i){case"string":return quote(i);case"number":return isFinite(i)?i+"":"null";case"boolean":case"null":return i+"";case"object":if(!i)return"null";if(gap+=indent,f=[],"[object Array]"===Object.prototype.toString.apply(i)){for(u=i.length,r=0;u>r;r+=1)f[r]=str(r,i)||"null";return o=0===f.length?"[]":gap?"[\n"+gap+f.join(",\n"+gap)+"\n"+a+"]":"["+f.join(",")+"]",gap=a,o}if(rep&&"object"==typeof rep)for(u=rep.length,r=0;u>r;r+=1)"string"==typeof rep[r]&&(n=rep[r],o=str(n,i),o&&f.push
@juancabrera
juancabrera / getCubicBezier.jsx
Last active April 25, 2021 01:43
After Effect Script for getting the cubic-bezier (css friendly) of a specific layer's transition
// Source:
// https://forums.adobe.com/thread/1471138
function getCubicbeziers(){
var curItem = app.project.activeItem;
var selectedLayers = curItem.selectedLayers;
var selectedProperties = app.project.activeItem.selectedProperties;
if (selectedLayers == 0){
alert("Please Select at least one Layer");
} else if(selectedLayers !=0){
@turbodrive
turbodrive / cubicBezierExporter.jsx
Last active November 23, 2019 03:34
Cubic bezier ease exporter from After Effects
var comp = app.project.activeItem;
var layer = comp.selectedLayers[0];
var numEffects = layer.Effects.numProperties;
var slider;
for(var i = 1; i<=numEffects; i++){
var effectLayer = layer.Effects.property(i);
var matchName = effectLayer.matchName;
if(matchName == "ADBE Slider Control"){
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 5, 2024 13:30
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx