Skip to content

Instantly share code, notes, and snippets.

@tmslnz
tmslnz / aerender.exe wrapper.ps1
Last active June 1, 2023 11:25
PowerShell wrapper for After Effects aerender.exe
<#
After Effects aerender.exe wrapper script
#>
[CmdletBinding(PositionalBinding = $false)]
param(
[String][parameter(Position=0)]$project_pparam,
[String]$project,
[String]$comp = "Main",
[string]$resolution = "Full",
@tmslnz
tmslnz / Tx.js
Last active November 6, 2021 01:10
Transform stack
/*
Utility to create and manage a stack of CSS transforms.
Supports namespaced properties.
Example:
var el = document.querySelector('#id');
var tx = new Tx();
Basic usage:
@tmslnz
tmslnz / getTranslate3d.js
Created February 25, 2017 15:03
Get and array of translate3d values
function getTranslate3d (el) {
var values = el.style.transform.split(/\w+\(|\);?/);
if (!values[1] || !values[1].length) {
return [];
}
return values[1].split(/,\s?/g);
}
@tmslnz
tmslnz / getTransforms.js
Created February 25, 2017 15:02
Get list of transform props
function getTransforms (el) {
var values = [];
var re = /\w+\(.+?\)/gi;
var match = [];
while ((match = re.exec(el.style.transform)) !== null) {
values.push(match[0]);
}
return values;
}
@tmslnz
tmslnz / getOffsetFromParent.js
Created February 25, 2017 15:01
Get HTMLElement offset relative to offsetParent, minus transforms
function getOffset (node) {
var doc = node.ownerDocument;
var docElem = doc.documentElement;
var win = doc.defaultView;
var rect;
var result;
try {
rect = node.getBoundingClientRect();
} catch (e) {
return { left: 0, top: 0 };
@tmslnz
tmslnz / getOffset.js
Created February 25, 2017 14:59
Get the absolute, untransformed offset of HTMLElement
function getAbsoluteOffset (el) {
var _x = 0;
var _y = 0;
while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) {
_x += el.offsetLeft;
_y += el.offsetTop;
el = el.offsetParent;
}
return { top: _y, left: _x };
}
@tmslnz
tmslnz / fix unity
Created February 22, 2017 18:07
Broken Unity
~/Library/Unity/Packages
These are copied in from Unity.app application bundle, at path:
/Applications/Unity/Unity.app/Contents/Resources/Packages
To fix by hand, until finding the source of the problem:
cd /
@tmslnz
tmslnz / project_presets.cfg
Created February 22, 2017 11:50
Modo Project Preset Template
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--
This file lives under
~/Library/Application Support/Luxology/Configs/project_presets.cfg
-->
<atom type="ProjectTemplates">
/*
Fix for missing realtime clock in OS X
======================================
author: jbenet
os x, compile with: gcc -o testo test.c
linux, compile with: gcc -o testo test.c -lrt
*/
#include <time.h>
#include <sys/time.h>
@tmslnz
tmslnz / HTTrack.md
Last active February 19, 2024 03:07
Nice command line for HTTrack

Commands

httrack example.com -O ./example.com -N100 −%i0 -I0 --max-rate 0 --disable-security-limits --near -v
httrack example.com -O ./example.com-3 -N100 -I0 -N "%p/%n%[month].%t" --max-rate 0 --disable-security-limits --near  -v