Skip to content

Instantly share code, notes, and snippets.

View djsegal's full-sized avatar

djsegal

  • home
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@djsegal
djsegal / swap_display.sh
Created August 27, 2024 14:52
Swap two identical dimension displays on MacOS using displayplacer and cliclick brew packages
#!/bin/bash
# Path to displayplacer and cliclick
DISPLAYPLACER="/opt/homebrew/bin/displayplacer"
CLICLICK="/opt/homebrew/bin/cliclick"
# Get current mouse position using cliclick
current_position=$($CLICLICK p | awk -F, '{print $1, $2}')
current_x=$(echo $current_position | awk '{print $1}')
current_y=$(echo $current_position | awk '{print $2}')
@djsegal
djsegal / Denglisch
Created April 27, 2024 12:38
A bookmarklet for loading German subtitles on Netflix using Language Reactor
javascript:(function() { function setTracks() { let video = document.querySelector('video'); if (!video || !window.lln || !window.lln.vidMan) return; let isGoodTrack = ( window.lln.setMan.sourceLanguageCode === "de" && window.lln.setMan.translationLanguageCode === "en" ); if (!isGoodTrack) { window.lln.vidMan.setAudioTrack("A:2:1;2;de;0;0;"); window.lln.vidMan.setSubtitleTrack("ASR_A:2:1;2;de;0;0;"); video.pause(); return; } let subsContent = document.querySelector("#lln-subs-content"); if (subsContent && subsContent.textContent.trim() === "- Loading subtitles, please wait... -") { if (!video.paused) video.pause(); setTimeout(setTracks, 1000); return; } if (video.paused) video.play(); } function waitForLLN(tries = 0) { if (document.querySelector('video') && window.lln && window.lln.vidMan) { setTracks(); return; } if (tries > 30) { console.error("Custom language connector failed."); return; } setTi