Skip to content

Instantly share code, notes, and snippets.

@gordielachance
gordielachance / ffmpeg_chapters_from_markers.jsx
Last active October 25, 2025 22:37
After Effects script that exports the active comp markers to a chapters file for FFMpeg.
// ================================
// Export AE markers to FFmpeg chapters (UTF-8 safe, FFmpeg compatible)
// Usage: ffmpeg -i input.mp4 -i chapters.txt -map_metadata 1 -c copy output.mkv
// ================================
{
// Check active comp
var comp = app.project.activeItem;
if (!(comp instanceof CompItem)) {
alert("Select a comp that has markers.");
} else {
@gordielachance
gordielachance / gist:dd4efcacf41ff33fa8263c426873c5be
Created September 25, 2025 21:30
Blender script : delete all materials from selected object
import bpy
obj = bpy.context.active_object
obj.data.materials.clear()
@gordielachance
gordielachance / getRelationChain.ts
Last active November 7, 2024 12:45
STRAPI V5 : Returns the full hierarchical chain of entries for the specified relation field (manyToOne)
//given an entity ID (not documentId),
//return the full chain of items for a relation field (manyToOne).
//NB: getRelationChainIds() uses a single DB request to retrieve the chain of IDs.
//How to use ?
//const chainItems = await getRelationChain(strapi,itemId,'api::category.category','parent');
//will return the whole hierarchy of items (as a flat ordered array) from the 'parent' field, for categories.
import _ from 'lodash';
@gordielachance
gordielachance / jspftypes.ts
Last active March 31, 2023 14:21
typescript JSPF tests
//
https://github.com/metabrainz/listenbrainz-server/blob/cdc4df46738402d7d003acf08febfe7c7cf2fe4f/frontend/js/src/utils/types.d.ts
export type URI = string;
export type URICollection = URI[];
export type JSPFAttribution = Record<string,URI>;
export type JSPFAttributionCollection = JSPFAttribution[];
export type JSPFLink = Record<URI,URI>;
{"properties":{"selectors":{"properties":{"track":{"properties":{"artist":{"properties":{"path":"artist"}},"title":{"properties":{"path":"title"}},"album":{"properties":{"path":"album"}},"image":{"properties":{"path":"cover"}}}}}}},"station_slug":"radio17bis"}
Hi, i've got problems validating parameters sent to my API route.
puts "PARAMS"
puts params.to_json
=begin
{
"url":"http://www.last.fm/user/grosbouff/loved",
"options":{
"selectors":{
"playlist":{
@gordielachance
gordielachance / AE expression : check for backfacing (2D layer)
Last active November 6, 2019 09:19
AE expression : check for backfacing (2D layer)
var rot = transform.xRotation;
var flipAngle = 180;
var flips = Math.round(rot / flipAngle);
var isFront = (flips%2) ? false : true;
@gordielachance
gordielachance / nthObjectSelector.py
Last active April 10, 2018 21:15
Blender script that reduce your section of objects to nth objects.
"""
nthObjectSelector by gordielachance
This will reduce your current selection of object to nth objects.
https://gist.github.com/gordielachance/ba32a3087f8d327bfdeb9d0ea7fb4935
"""
import bpy
#SETUP
nth = 3 #Specify your nth value here !
@gordielachance
gordielachance / openprice.php
Last active March 7, 2018 08:15
The Events Calendar - Open Price module
<?php
//Add this in your functions.php file
add_action( 'tribe_events_cost_table', 'event_backend_open_price', 9 );
add_action( 'tribe_events_event_save', 'event_save_open_price', 10, 3 );
add_filter( 'tribe_get_cost','event_get_open_price',10,3);
function event_backend_open_price($event_id){
$isOpenPrice = ($event_id) ? get_post_meta( $event_id, '_EventOpenPrice', true ) : false;
?>
@gordielachance
gordielachance / After Effects Expression : Reveal text (TypeOn + blinking cursor)
Last active May 21, 2022 13:36
After Effects Expression : Reveal text (TypeOn + blinking cursor)
//put this expression for the 'Source Text' value on your text layer, and add 4 markers on the layer : 'cursorStart', 'textStart', 'textStop', 'cursorStop'
cursor="|";
cursorBlink = 1; //seconds
txt = value;
timeIn = thisLayer.inPoint; //seconds
txtSize = text.sourceText.length;
animateText = true;
showCursor = true;