Skip to content

Instantly share code, notes, and snippets.

View marco-van-zomeren's full-sized avatar
:octocat:
Hello world!

marco-van-zomeren

:octocat:
Hello world!
View GitHub Profile
<?php
$price = get_post_meta( get_the_ID(), '_price', true );
if ( $price > 0 ) {
echo wc_price( $price );
}
?>
amp = .06; // amplitude
freq = 2; // frequency
decay = 7; // decay (the more the value, the faster oscillations fade)
//----------------------------------
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}
effect("Slider Control")("Slider").value.toFixed(0)
or
num = value;
function addCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
tx=thisComp.layer("Text"); // change to your text-layer's name
margin_H = 50;
margin_V = 33;
// margins relative to fontSize
margin_H = margin_H * tx.text.sourceText.style.fontSize/100;
margin_V = margin_V * tx.text.sourceText.style.fontSize/100;
sr=tx.sourceRectAtTime();
@marco-van-zomeren
marco-van-zomeren / gist:5782687167d9197cb4464b947232eb88
Created April 26, 2023 09:54
After Effects - Slider control number
num = effect("Slider Control")("Slider").value.toFixed(0);
function addCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
}
addCommas(num);