Skip to content

Instantly share code, notes, and snippets.

View trych's full-sized avatar

trych

View GitHub Profile
@trych
trych / Docs_MultiKeywords.md
Last active September 9, 2023 01:40
Multi-Keywords Plug-in for Lightroom Classic

Multi-Keywords Plugin for Lightroom Classic

Small LrC plug-in that enables a very specific workflow for rapidly applying multiple keywords at once via LR's keyword sets.

This will be mainly helpful for situations where you need to tag photos with 3 or 4 different subjects that might appear in the photos in different combinations. A typical example would be family photos with 3-5 different family members. Also, this plugin makes mostly sense when you tag your photos one after the other instead of selecting a bunch of photos at once.

In my search for the most rapid way to tag such photos I find the described workflow the quickest. However, your milage, or your style of tagging, might vary.

Download

multi-keywords.lrplugin.zip

@trych
trych / index.php
Created October 6, 2022 08:35
Null error issue in argument expressions of e()
<?php
$poster = $video->poster()->toFile();
// das geht nicht, wenn $poster null ist, *obwohl* die var $poster existiert
// Call to a member function resize() on null
e($poster, Html::attr('poster', $poster->resize(1280)->url()));
// das hingegen funktioniert:
if($poster) echo Html::attr('poster', $poster->resize(1280)->url());
@trych
trych / index.php
Created October 5, 2022 21:53
getkirby e() helper function that does not throw error on undefined variable
<?php
function e(&$condition, $value, $alternative = null) {
echo $condition ? $value : $alternative;
}
$class = "banana";
e($class, 'class="' . $class . '"');
e($anotherClass, 'class="' . $anotherClass . '"');
@trych
trych / pixi-js-slideshow.js
Created January 22, 2020 22:55
Pixi.js code that produces the blur problem
const canvasScale = 1.06;
const landscapeRatio = 0.9;
const portraitRatio = 0.5;
const targetScale = 1.2;
const blurStrength = 12;
let blurFilters = [];
var anim = {
globalOffset: 0,
globalPos: 1,
@trych
trych / ExtendScript.sublime-syntax
Created January 7, 2020 11:27
ExtendScript Syntax highlighting
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: ExtendScript
file_extensions:
- jsx
- jsxinc
scope: source.jsx
contexts:
main:
@trych
trych / getLastInlineRange.js
Last active September 6, 2019 14:43
Demonstrates how to retrieve a text object resembling the last text style range *within* a single line.
#target indesign
// use on some text frame with several text style ranges in the first line
// if the text range continues into the second line, only the range within the first line will be returned
var l = app.activeDocument.textFrames.firstItem().lines.firstItem();
var lir = getLastInlineRange(l);
app.select(lir);
function getLastInlineRange(l) {
var ltsr = l.textStyleRanges.lastItem();
@trych
trych / ExportMailAdresses.scpt
Last active July 26, 2019 09:38
Exports all "From" addresses of a specific email inbox to Numbers for further processing. Duplicates are still present and need to be removed in the spreadsheet app.
tell application "Numbers"
set LinkRemoval to make new document
set theSheet to active sheet of LinkRemoval
tell table 1 of theSheet
set the value of cell 1 of column "A" to "From"
end tell
end tell
@trych
trych / DottedCircle.pde
Created June 8, 2018 23:02
A dotted circle in Processing. Note that the dotted line is only faked by drawing lines in the background color on top.
size(512, 512);
background(255);
strokeWeight(20);
translate(width / 2, height / 2);
ellipse(0, 0, 400, 400);
stroke(255);
// @includepath "~/Documents/;%USERPROFILE%Documents";
// @include "basiljs/basil.js";
// HOW TO USE:
// - to run the script, you first need to install basil.js: http://basiljs.ch
// - Make sure, you're on the first page of your doc
// - select the page item that you want to appear in the fore edge
// - rotate it accordingly
// - if using text, convert to outlines
// - run the script, enter the required # of pages
@trych
trych / Bundschnitt.js
Last active August 2, 2016 22:37
Bundschnitt erstellen
#target indesign
var doc = app.activeDocument;
doc.viewPreferences.rulerOrigin = RulerOrigin.SPREAD_ORIGIN;
doc.documentPreferences.allowPageShuffle = false;
cleanDocument(doc);