Skip to content

Instantly share code, notes, and snippets.

View Jered's full-sized avatar

Jered Cuenco Jered

  • Portland, OR
View GitHub Profile
@Jered
Jered / AE_auto-orient.js
Last active March 31, 2025 17:01
After Effects Auto-Orient Expression
cornerEase = 3; // sets the amount to look ahead and behind for gradual turns
pre = position.valueAtTime(time-thisComp.frameDuration*cornerEase);
post = position.valueAtTime(time+thisComp.frameDuration*cornerEase);
delta = post-pre;
if (delta[0] == 0 && delta[1] == 0) {
// if there is no change in vector maintain the current heading
rotation;
} else {
// use the vector direction to orient. Flip the Y to account for cartesian Y being up and AE Y being down
radiansToDegrees(Math.atan2(delta[0],-delta[1]));
@Jered
Jered / LogoTitle.swift
Last active February 16, 2018 21:00
Replace Navigation Item Text Title with an Image
// Logo in place of title function (Swift 4)
// call this from viewDidLoad()
private func setSwooshTitle() {
// set the navigation title to a bundled image
let logoWidth = 60
let logoHeight = 44 // this is actually the height of the navbar
let bundle = Bundle(for: type(of: self)) // get the asset bundle
let logo = UIImage(named: "icons.logo", in: bundle, compatibleWith: self.traitCollection)!
let imageView = UIImageView(frame: CGRect(x: -logoWidth/2, y: -logoHeight/2, width: logoWidth, height: logoHeight)) // set the bounds and positioning for the logo