Skip to content

Instantly share code, notes, and snippets.

View opicron's full-sized avatar

Robbert Langezaal opicron

View GitHub Profile
@opicron
opicron / metakeys.json
Created September 7, 2024 08:01 — forked from jordymeow/metakeys.json
This JSON lists the metadata types Lightroom manages for photos, from creator details to location info, detailing each key with its data type and description. The photo:getFormattedMetadata(key) function in the Lightroom SDK retrieves this metadata in a user-friendly format for display, mirroring Lightroom's layout, rather than for parsing.
{
"additionalModelInfo": {"type": "string", "description": "Information about the ethnicity and other facets of models in a model-released image."},
"aperture": {"type": "string", "description": "The aperture (for example, 'f/2.8')."},
"artist": {"type": "string", "description": "The artist's name."},
"artworksShown": {"type": "table", "description": "A set of metadata about artwork or an object in the image. Each element in the table is a structure named ArtworkOrObjectDetails, as defined in the IPTC Extension spec."},
"brightnessValue": {"type": "string", "description": "The brightness value."},
"cameraMake": {"type": "string", "description": "The camera manufacturer."},
"cameraModel": {"type": "string", "description": "The camera model."},
"cameraSerialNumber": {"type": "string", "description": "The camera serial number."},
"caption": {"type": "string", "description": "The caption for photo."},
@opicron
opicron / metakeys.json
Created September 7, 2024 08:01 — forked from jordymeow/metakeys.json
This JSON lists the metadata types Lightroom manages for photos, from creator details to location info, detailing each key with its data type and description. The photo:getFormattedMetadata(key) function in the Lightroom SDK retrieves this metadata in a user-friendly format for display, mirroring Lightroom's layout, rather than for parsing.
{
"additionalModelInfo": {"type": "string", "description": "Information about the ethnicity and other facets of models in a model-released image."},
"aperture": {"type": "string", "description": "The aperture (for example, 'f/2.8')."},
"artist": {"type": "string", "description": "The artist's name."},
"artworksShown": {"type": "table", "description": "A set of metadata about artwork or an object in the image. Each element in the table is a structure named ArtworkOrObjectDetails, as defined in the IPTC Extension spec."},
"brightnessValue": {"type": "string", "description": "The brightness value."},
"cameraMake": {"type": "string", "description": "The camera manufacturer."},
"cameraModel": {"type": "string", "description": "The camera model."},
"cameraSerialNumber": {"type": "string", "description": "The camera serial number."},
"caption": {"type": "string", "description": "The caption for photo."},
@opicron
opicron / tokenReplace.bat
Created April 15, 2024 09:53 — forked from richard087/tokenReplace.bat
Batch file to do a token replacement on a text file, in Windows.
@echo off
rem sourced from http://stackoverflow.com/questions/5273937/how-to-replace-substrings-in-windows-batch-file
setlocal enabledelayedexpansion
set INTEXTFILE=test.txt
set OUTTEXTFILE=test_out.txt
set SEARCHTEXT=bath
set REPLACETEXT=hello
set OUTPUTLINE=
for /f "tokens=1,* delims=¶" %%A in ( '"type %INTEXTFILE%"') do (
@opicron
opicron / docker-iptables-fix.sh
Created October 20, 2022 10:41 — forked from pedrolamas/docker-iptables-fix.sh
Script to fix Docker iptables on Synology NAS
#!/bin/bash
currentAttempt=0
totalAttempts=10
delay=15
while [ $currentAttempt -lt $totalAttempts ]
do
currentAttempt=$(( $currentAttempt + 1 ))
echo "Attempt $currentAttempt of $totalAttempts..."
@opicron
opicron / self-update-script.py
Last active October 20, 2022 10:41 — forked from gesquive/self-update-script.py
python self update #python
def update(dl_url, force_update=False):
"""
Attempts to download the update url in order to find if an update is needed.
If an update is needed, the current script is backed up and the update is
saved in its place.
"""
import urllib
import re
from subprocess import call
def compare_versions(vA, vB):
@opicron
opicron / functions.php
Last active October 20, 2022 10:39 — forked from Jon007/functions.php
Add default Product Attributes to all WooCommerce products #php #woocommerce
/*
* Example adds certain named Product Attribute fields to the product Edit screen ready for completion.
* (Pre-requisite )
* This saves the Shop Admin having to add them manually.
*
* Why might you want to do this instead of adding Custom fields? There's plenty of nice documentation on adding custom fields
* for example: http://www.remicorson.com/mastering-woocommerce-products-custom-fields/
*
* Well a Product Attributes are a built in WooCommerce feature, using Terms which are a built in Wordpress feature.
* - no add-ons required