Skip to content

Instantly share code, notes, and snippets.

View Daij-Djan's full-sized avatar

Dominik Pich Daij-Djan

View GitHub Profile
@Daij-Djan
Daij-Djan / trim-drawthings.sh
Created September 9, 2026 04:09
Trim a Draw Things project to: current moodboard + one history frame (or one lineage).
#!/bin/zsh
# Trim a Draw Things project to: current moodboard + one history frame (or one lineage).
# The source file is never modified. See SKILL.md for the format reference.
set -euo pipefail
DOCS="$HOME/Library/Containers/com.liuliu.draw-things/Data/Documents"
usage() {
cat >&2 <<EOF
Usage: trim.sh <source.sqlite3> <output-name> [lineage] [seq]
@Daij-Djan
Daij-Djan / outlook_to_sieve.py
Created September 8, 2026 04:23
outlook filters to spamsieve
#!/usr/bin/env python3
"""
outlook_to_sieve.py
Convert the CSV produced by:
> brew install powershell
> pwsh
> Connect-ExchangeOnline -UserPrincipalName your_email@host.de
> Get-InboxRule -Mailbox your_email@host.de | Select-Name, Description, Enabled | Export-Csv -Path "$env:USERPROFILE\Desktop\OutlookRules.csv" -NoTypeInformation
@Daij-Djan
Daij-Djan / dropbox-backup.sh
Created September 1, 2026 15:58
dropbox-backup.sh - script to backup dropbox via rclone
#!/usr/bin/env bash
set -euo pipefail
# โ”€โ”€ dropbox-backup โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
# Ad-hoc, on-demand backup of the ENTIRE Dropbox account to the LaCie drive.
#
# Pulls straight from the Dropbox cloud over the API via rclone. It does NOT
# read, touch, or depend on the local Dropbox sync folder
# (~/Library/CloudStorage/Dropbox), so it can't disturb normal Dropbox sync,
# and it also captures the ~4k files that are currently "online only".
@Daij-Djan
Daij-Djan / make_contact_sheets.sh
Created August 16, 2026 02:37
make a photosheet for photos in folder
#!/bin/bash
# Usage: make_contact_sheets.sh <source_dir> <dest_dir>
# Builds numbered contact-sheet grids (chronological, labeled by filename) for one event.
set -e
SRC="$1"
DEST="$2"
CHUNK=24 # photos per sheet
TILE="6x4"
THUMB="240x240"
#!/bin/bash
# Dropbox โ†’ Nextcloud import script for <<USER>>
# -----------------------------------------------
set -euo pipefail
BASE_DIR="/home/roesrathkleineichen/domains/<<DESTINATION>>"
RCLONE="/usr/bin/rclone"
PHP="/usr/bin/php"
cd "$BASE_DIR" || { echo "โŒ Failed to cd to $BASE_DIR"; exit 1; }
@Daij-Djan
Daij-Djan / button_mash_ps5.gph
Created December 10, 2021 22:28
Button mash for PS5:: Holding down square, cross, circle or triangale button for automatic repetition instead of press (fast button mash), On / Off: Press create button : to disabled/enable AutoCombo. (rumbles on activate), Hold create button 1s for normal options menu
#pragma METAINFO("button_mash_ps5", 1, 1, "Daij-Djan")
#include <ps5.gph>
/*
<shortdesc>
Button mash for PS5
AutoCombo : Holding down square, cross, circle or triangale button for automatic repetition instead of press (fast button mash)<br>
On / Off : Press share button : to disabled/enable AutoCombo. (rumbles on activate)<br>
Hold share button 1s for normal options menu
</shortdesc>
@Daij-Djan
Daij-Djan / xcode_project_file_count.rb
Created July 5, 2021 15:51
show use of xcodeproj package
#!/usr/bin/ruby
require 'xcodeproj'
projects = {
'my app: variant a' => '/Users/dpich/Desktop/e80f427ed_a.xcodeproj',
'my app: variant b' => '/Users/dpich/Desktop/e80f427ed_a_modified.xcodeproj',
}
puts "# File Counts"
p="/Users/dpich/Desktop/t/bilder/impressionen/"
echo $p
t="/Users/dpich/Dropbox (Personal)/Maria's Art/__Copies For Website/Impressionen/"
echo $t
cd "$t"
for f in `ls $p`; do
file=$p/$f
img=`pcregrep -o1 -e "<img src=\"(.*_med).*\\.jpeg\"" "$file"`
img_path=$p/$img"_hr.jpeg"
#!/bin/bash
files=`find ~/Desktop/maria -name *_med*.jpeg -a -not -name maria*.jpeg`
text="ยฉ Maria Pich 2020"
for file in $files; do
echo "Add watermark to $file"
magick convert "$file" -font Helvetica -pointSize 15 -draw "gravity SouthEast fill grey text 50,30 '$text' fill white text 51,31 '$text'" "$file"
done
@Daij-Djan
Daij-Djan / listprofiles.sh
Last active January 31, 2020 00:44
get provisioning profiles and their bundle ids, names and creation dates
#!/bin/bash
for f in ~/Library/MobileDevice/Provisioning\ Profiles/*
do
echo \
$(basename "${f%.*}") \
"=> " \
`security cms -D -i "$f" | plutil -extract "Entitlements.application-identifier" xml1 -o - -- - | sed -n -e 's/.*<string>\(.*\)<\/string>.*/\1/p'`
echo " Name: "\