Skip to content

Instantly share code, notes, and snippets.

View juliendargelos's full-sized avatar
🌫️

Julien Dargelos juliendargelos

🌫️
View GitHub Profile
@juliendargelos
juliendargelos / force-original-youtube-audio-track.js
Last active January 1, 2025 22:21
User Script that forces original audio track on YouTube videos
// ==UserScript==
// @name Force original audio track on YouTube videos
// @match https://youtube.com/*
// @match https://www.youtube.com/*
// ==/UserScript==
const ORIGINAL_AUDIO_TRACK_NAME_PATTERN = /^.+?\([^\)]+\)\s+[^\(\)]+|.+?\s+original$/
new MutationObserver(debounce(100, update)).observe(document.head, {
childList: true,
@juliendargelos
juliendargelos / signing-safari-extension.md
Last active December 16, 2024 19:16
How to sign a Safari Extension for just one computer?

Signing safari extension

Question and answer with screenshots by kneedhelp (stackoverflow.com/a/62748969):

How can I sign a Safari Extension for just one computer?

I wrote a Safari Extension that I'd like to have permanently enabled on my computer. It works fine, but I have to click DevelopAllow Unsigned Extensions and enable it manually every time I open Safari for it to be available. I'm not really sure how the signing process works. Is there a way I can sign my extension for only this computer, without having to subscribe to an Apple Developer account?

First thing to do was to create a development account with Apple (the free version). Then click on [Project Name]Build Settings and ensure "Development Team" has your account selected (you'll have to add your account in XcodeSettingsAccounts if you haven't done so already).

![ZowGd](https://gist.github.com/user-attachments/asse

@juliendargelos
juliendargelos / markdown-alert-info-blockquote.md
Created December 16, 2024 18:46
Markdown alert/info blockquote

Markdown alert/info blockquote

Note

Highlights information that users should take into account, even when skimming.

Tip

Optional information to help a user be more successful.

Important

Crucial information necessary for users to succeed.

@juliendargelos
juliendargelos / how-to-fix-outdated-autofill-address-in-safari.md
Last active December 16, 2024 19:06
How to fix outdated address autofill in Safari

How to fix outdated address autofill in Safari

Despite providing all your correct informations in your personal contact card, Safari may still try to autocomplete with an old address. I struggled with this issue for months but finally managed to fix it thanks to this reddit answer.

Note

Please take the time to upvote the original reddit answer.

[!CAUTION]

@juliendargelos
juliendargelos / prevent-mac-os-mission-control-from-randomly-switching-desktop-space.md
Last active December 14, 2024 23:41
Prevent Mac OS mission control from randomly switching desktop space.

Based on this post:

defaults write com.apple.Dock workspaces-auto-swoosh -bool NO
defaults write -g AppleSpacesSwitchOnActivate -bool false
killall Dock
@juliendargelos
juliendargelos / remove-change-extension.sh
Created June 30, 2022 12:01
Remove or change a file extension in a bash string
file=index.js
"${file%.*}.html"
@juliendargelos
juliendargelos / scale-vec2-buffer-array.js
Last active August 2, 2021 20:32
Arithmetic mapping function that scales a vec2 buffer array
/**
* Creates a mapping function that scales a vec2 buffer array
*
* @param {number} x x scale
* @param {number} y y scale
* @return {function} method to pass to Array.prototype.map
*
* @example
*
* [
@juliendargelos
juliendargelos / _test-spritesheets.md
Last active July 29, 2021 15:32
Test spritesheets created with Sketch and Free Texture Packer.

Test spritesheets

In order to implement a spritesheet system for free texture packer, I needed test sprites that I can use to create spritesheets with different configurations. I couldn't find anything satisfactory on the web so I did it myself and chose to share my source and export files.

Files

  • sprites.zip
    Raw sprites exported from Sketch as single png files

  • spritesheet-rotated.json

@juliendargelos
juliendargelos / ffmpeg-change-volume.sh
Created June 1, 2021 13:02
FFmpeg command that changes audio volume by factor or relative dB value.
ffmpeg -i input.mp3 -filter:a "volume=0.5" output.mp3
ffmpeg -i input.mp3 -filter:a "volume=5dB" output.mp3
ffmpeg -i input.mp3 -filter:a "volume=-5dB" output.mp3
@juliendargelos
juliendargelos / remove-all-from-docker.sh
Created February 21, 2021 21:37 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes