Skip to content

Instantly share code, notes, and snippets.

View philippgitpush's full-sized avatar
🌱
Dandori issue

Philipp philippgitpush

🌱
Dandori issue
View GitHub Profile
@philippgitpush
philippgitpush / twitterCopyToObsidianEmbed.js
Last active June 26, 2024 15:58
Userscript that adds a button on X (Formerly Twitter) that allows you to copy a tweet to the obsidian embed format (user plugin)
// ==UserScript==
// @name X Embed Button
// @version 1.0.1
// @description Userscript that adds a button on X (Formerly Twitter) that allows you to copy a tweet to the obsidian embed format (user plugin)
// @author philippgitpush
// @match https://x.com/*
// @grant none
// ==/UserScript==
(function() {
@philippgitpush
philippgitpush / bulkRename.cs
Created June 17, 2024 16:12
Unity editor script to bulk rename the children of a given gameobject
using UnityEngine;
using UnityEditor;
public class RenameChildren : EditorWindow {
private static readonly Vector2Int size = new Vector2Int(250, 100);
private string childrenPrefix;
private int startIndex = 0;
[MenuItem("GameObject/Rename children")] public static void ShowWindow() {
EditorWindow window = GetWindow<RenameChildren>();
@philippgitpush
philippgitpush / enhancedXVideoPlayer.js
Last active June 5, 2024 18:54
Userscript that changes X's (Formerly Twitter) video player UX to the browser's default and adds volume control memory
// ==UserScript==
// @name Enhanced X Video Player
// @version 1.0.1
// @description Enhance X video player with volume control memory.
// @author philippgitpush
// @match https://x.com/*
// @grant none
// ==/UserScript==
(() => {
@philippgitpush
philippgitpush / moveJPGBasedOnDNG.ps1
Last active June 5, 2024 18:57
PowerShell script for organizing JPG files into corresponding folders within the 'JPG' directory, based on the presence of matching DNG files in the 'RAW' directory
# Path to the current directory
$baseFolder = Get-Location
# Path to the JPG folder
$jpgFolder = Join-Path $baseFolder "JPG"
# Path to the RAW folder
$rawFolder = Join-Path $baseFolder "RAW"
# Iterate through all .jpg files in the JPG folder
@philippgitpush
philippgitpush / ffmpegAudioConversion.sh
Last active June 5, 2024 18:51
Collection of ffmpeg conversion scripts (mp3 / flac / wav)
# Flac to mp3, Single File
ffmpeg -i input.flac -ab 320k -ar 44100 output.mp3
# Flac to mp3, Current Dir
for file in *.flac; do
[ -e "$file" ] || continue
ffmpeg -i "$file" -ab 320k -ar 44100 "${file%.flac}.mp3"
done
rm -f *.flac
@philippgitpush
philippgitpush / indesignCoordinatesExtraction.jsx
Last active June 5, 2024 18:46
Adobe InDesign script for extracting object coordinates
// Load the required libraries
#target "InDesign"
#targetengine "session"
// Create a new panel
var myPanel = new Window("palette", "Coordinates Extraction", undefined);
// Add content to the panel
var label = myPanel.add("statictext", undefined, "Coordinates:");
label.alignment = "left";
@philippgitpush
philippgitpush / barrierKeyGen.sh
Last active June 5, 2024 18:49
Script for generating a self-signed SSL certificate using OpenSSL on Windows, specifically for use with the Barrier KVM software.
"C:\Program Files\Git\usr\bin\openssl.exe" req -x509 -nodes -days 3365 -subj /CN=Barrier -newkey rsa:4096 -keyout Barrier.pem -out Barrier.pem -sha256
@philippgitpush
philippgitpush / captureCardVLC.bat
Last active June 5, 2024 18:50
Script for quickly starting VLC to view the video feed from a capture device, such as the Elgato Game Capture HD60 S+, with settings for aspect ratio and low latency
@echo off
cd "C:\Program Files\VideoLAN\VLC"
set /p include_audio=Include audio? (Y/N):
if /i "%include_audio%"=="Y" (
start "" vlc.exe --no-qt-privacy-ask --no-qt-updates-notif --no-video-title-show dshow:// :dshow-vdev="Game Capture HD60 S+" :dshow-adev="Digital Audio Interface (Game Capture HD60 S+)" :live-caching=120 :dshow-aspect-ratio=16\:9
) else (
start "" vlc.exe --no-qt-privacy-ask --no-qt-updates-notif --no-video-title-show dshow:// :dshow-vdev="Game Capture HD60 S+" :dshow-adev=none :live-caching=0 :dshow-aspect-ratio=16\:9
)
@philippgitpush
philippgitpush / renderTemplateFile.php
Last active February 7, 2023 11:39
Dynamic template rendering in PHP
<?php
// Following object is empty, this should be filled from a DB or CMS
$page = new stdClass();
// Example of using a template file
function renderTemplateFile($templateFile, $variables) {
// Start a new output buffer
ob_start();