Skip to content

Instantly share code, notes, and snippets.

@ntippie
ntippie / sync-icloud-steam-balatro.py
Last active June 16, 2025 00:57
Mac python script to sync Balatro profiles between Steam and iCloud
#!/usr/bin/python3
# adapted from https://github.com/TomJinW/BalatroSave_AppleArcadeMac
import plistlib
from os.path import expanduser, getmtime, join, exists, basename, dirname, isfile
from datetime import datetime
from os import utime, makedirs, listdir
ICLOUD_PATH = f"~/Library/Containers/com.playstack.balatroarcade/Data/Library/Preferences/com.playstack.balatroarcade.plist"
STEAM_PATH = f"~/Library/Application Support/Balatro/"
@ntippie
ntippie / pip.js
Last active March 23, 2024 21:24
Video Picture-in-Picture Bookmarklet w/ Shadow DOM support
javascript:(function(){ function findAllVideosIncludingShadowDOM(startingElement) { let videos = []; function searchForVideos(node) { if (node.tagName === 'VIDEO') videos.push(node); if (node.shadowRoot) searchForVideos(node.shadowRoot); if (node.childNodes.length) node.childNodes.forEach(searchForVideos); } searchForVideos(startingElement); return videos; } var video = findAllVideosIncludingShadowDOM(document)[0]; video.removeAttribute('disablePictureInPicture'); video.requestPictureInPicture(); })();
@ntippie
ntippie / ami-lookup.ts
Last active January 10, 2024 18:56
AWS CDK v2 AwsCustomResource to look up an AMI
import {
type IMachineImage,
OperatingSystemType,
UserData,
} from 'aws-cdk-lib/aws-ec2';
import {
AwsCustomResource,
AwsCustomResourcePolicy,
PhysicalResourceId,
} from 'aws-cdk-lib/custom-resources';
@ntippie
ntippie / sidekiq_worker_killer.rb
Last active June 21, 2018 04:19
Sidekiq Worker Killer
# https://github.com/gitlabhq/gitlabhq/blob/master/lib/gitlab/sidekiq_middleware/memory_killer.rb
class SidekiqWorkerKiller
include Sidekiq::Util # for #hostname
# Maximum RSS in KB for (default 0, meaning the WorkerKiller is disabled)
MAX_RSS = (ENV['WORKER_KILLER_MAX_RSS'] || 0).to_s.to_i
# Wait in seconds for running jobs to finish during graceful shutdown (default 60 minutes)
SHUTDOWN_WAIT = (ENV['WORKER_KILLER_SHUTDOWN_WAIT'] || 60 * 60).to_s.to_i
# Wait in seconds for process to exit after SIGTERM (default 60 seconds)