Skip to content

Instantly share code, notes, and snippets.

View spooky063's full-sized avatar
πŸ‘‹
πŸ‡«πŸ‡· 🏠 😎 🧒

Guillaume spooky063

πŸ‘‹
πŸ‡«πŸ‡· 🏠 😎 🧒
View GitHub Profile
@spooky063
spooky063 / test-drupal-php-8.3-core.md
Last active March 27, 2025 14:38
Test Drupal core modules

If you want to test your issue before pushing into Drupal git repository, you may have to use this command.

It uses a PHP 8.3 image from drupal-ci community.
In this example, we test only the CKEditor5PluginManagerTest.php file.
Then, I change the permission by my user local machine changed by the server-setup.sh script.

docker run --rm -it -v .:/var/www/html drupalci/php-8.3-ubuntu-apache:production \
  sh -c " \
  rm -rf ./subdirectory; \
@spooky063
spooky063 / gpg-key.md
Created February 20, 2025 10:14
Sign Github commit with GPG key

Generate GPG key

gpg --full-generate-key
  • Answer 1: RSA et RSA
  • Answer 2: 4096
  • Answer 3: 0
  • Answer 4: Use the same name and email address that Github account
@spooky063
spooky063 / github-connection.md
Created February 20, 2025 09:50
Check Github connection

Removes all keys belonging to the specified hostname from a known_hosts file

ssh-keygen -R github.com

Before this command, be sure the ssh-keygen was created and added to your Github repository

ssh-add ~/.ssh/github
@spooky063
spooky063 / YouTube bookmark.md
Last active May 27, 2025 14:57
Bookmark to organize YouTube videos on the home page by date (french language)

Add these bookmark on your browser and paste it to URL field (tested with Google Chrome).

On the homepage, sorts videos by ascending publication date.

javascript:(function(){'use strict';function parseDate(dateString){if(typeof dateString!=='string'||!dateString.trim()){return new Date()}const today=new Date();const[_,value,unit]=dateString.match(/il y a (\d+) (\w+)/)||[];if(unit===undefined){return}const number=parseInt(value,10);if(unit.includes("heure")){return new Date(today.getTime()-number*60*60*1000)}if(unit.includes("minute")){return new Date(today.getTime()-number*60*1000)}if(unit.includes("jour")){return new Date(today.getTime()-number*24*60*60*1000)}if(unit.includes("semaine")){return new Date(today.getTime()-number*7*24*60*60*1000)}if(unit.includes("mois")){return new Date(today.setMonth(today.getMonth()-number))}if(unit.includes("an")||unit.includes("ans")){return new Date(today.setFullYear(today.getFullYear()-number))}return today}const videoElements=Array.from(document.querySelectorAl
@spooky063
spooky063 / remove-sponso-tweets.js
Last active February 19, 2025 11:26
Remove all sponsorized tweets
// Go to x.com (DO NOT navidate between tabs), open the console and launch this command:
document.querySelectorAll('article > div > div > div:nth-child(2) > div:nth-child(2)').forEach((n) => n.childNodes.length === 5 ? n.closest('article').remove() : null)
// Then change the tabs to the other option (For you / Subscriptions)
@spooky063
spooky063 / lighthouse.sh
Last active February 17, 2025 11:18
lighthouse-docker
mkdir ~/lighthouse
docker container run --rm -it \
--cap-add=SYS_ADMIN \
--user $(id -u) \
-v ~/lighthouse:/home/chrome/reports \
-e TARGET_URL=https://google.com \
justinribeiro/lighthouse \
sh -c 'echo y | /usr/bin/lighthouse --quiet --chrome-flags="--headless --disable-gpu --disable-dev-shm-usage" $TARGET_URL'