Skip to content

Instantly share code, notes, and snippets.

View MrZyr0's full-sized avatar

Julien SEIXAS MrZyr0

View GitHub Profile
@MrZyr0
MrZyr0 / Git-edit-commits.sh
Created June 22, 2022 07:48
Use `git filter-branch` to do some processing on all commits of a branch
#!/bin/bash
git filter-branch --env-filter '
WRONG_EMAIL="john@example.com"
NEW_NAME="John Doe"
NEW_EMAIL="doe@exmaple.com"
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
then
export GIT_COMMITTER_NAME="$NEW_NAME"
@MrZyr0
MrZyr0 / autoScrollerPresentation.js
Created August 27, 2021 16:20
A simple js script to present websites beautifully
// Add here all scroll value you want (each scroll steps). Scroll manually and use pageYOffset to setup it
// If empty, the script will automaticly scroll by 90% of the window height
const scrollOffsets = []
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function a() {
const scrollElementHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight,
@MrZyr0
MrZyr0 / blockDeletionBlocker.js
Created July 30, 2021 12:26
Prevent Gutenberg Block from deletion
const blockNameToPrevent = 'core/block';
const getBlockList = () => wp.data.select( 'core/block-editor' ).getBlocks();
let blockList = getBlockList();
wp.data.subscribe( () => {
const newBlockList = getBlockList();
const blockListChanged = newBlockList !== blockList;
if ( blockListChanged && newBlockList.length < blockList.length ) {
const removedBlock = blockList.filter( ( x ) => ! newBlockList.includes( x ) )[ 0 ];
@MrZyr0
MrZyr0 / Darkreader-custom-theme-styles.css
Created January 28, 2021 22:03
This is the content of developper window in Dark Reader extension
*
INVERT
.jfk-bubble.gtx-bubble
.captcheck_answer_label > input + img
CSS
.vimvixen-hint {
background-color: ${#ffd76e} !important;
border-color: ${#c59d00} !important;
UPDATE wp_options SET option_value = replace(option_value, 'http://oldurl', 'https://newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'oldurl','newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://oldurl', 'https://newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://oldurl','https://newurl');
@MrZyr0
MrZyr0 / gist:43f059fbbdcfff7c9757bf919d00f8fe
Last active October 27, 2020 18:28 — forked from jansanchez/gist:ce5b0ca1c5e538f4b266
How to install NVIDIA video drivers in Elementary OS

Install proprietary NVIDIA Drivers on Elementary OS 5

  1. As usual, please update your system before doing anything.

    sudo apt update
    sudo apt full-upgrade
  2. First of all, download the appropriate driver for your chipset: https://www.nvidia.com/Download/index.aspx

@MrZyr0
MrZyr0 / Clean Google Maps API v3 with multiple markers & infoWindows
Last active November 7, 2020 21:06
A clean way to use Google Maps API v3 with multiple cursor & infoWindows
// ⚠ Fork of https://gist.github.com/rbochet/888937/cbc176598725b4e5ad300bd24fee68bcefb87516 ⚠
// Use https://github.com/Concept211/Google-Maps-Markers#usage-premade : For icons !
/**
* Marker JSON schema:
* {
* location: 'LatLng Google map object', // This will overide latitude and longitude properties
* latitude: 'The latitude of the marker',
* longitude: 'The longitude of the marker',
* icon: 'The URL of the icon to use' // By default it the red classic one*
@MrZyr0
MrZyr0 / Download G ads invocies
Created February 25, 2020 09:38
Bookmarlet to quickly download all G Ads invoices
let collection = document.getElementsByClassName("b3id-document-zippy-line-item-header b3-document-zippy-line-item-header goog-control");
let invoiciesURL = [];
for (let item of collection)
{
if (item.textContent.includes('(Date de création'))
{
invoiciesURL.push('https://payments.google.com' + item.getAttribute('data-download-url'));
}
}
{ "type": "Feature", "properties": { "number": 9013, "name": "Sédaillan \/ Naviguation", "address": "Quai Paul Sédallon", "address2": "", "commune": "Lyon 9 ème", "nmarrond": 13, "bonus": "Non", "pole": "pôle d'activité (Cegid, Infogrammes)", "lat": 45.787384084955796, "lng": 4.81437377940006, "bike_stands": 20, "status": "OPEN", "available_bike_stands": 7, "available_bikes": 13, "availabilitycode": 1, "availability": "Vert", "banking": 0, "gid": 1065, "last_update": "2017\/02\/02 14:49:23", "last_update_fme": "2017\/02\/02 14:54:00" }, "geometry": { "type": "Point", "coordinates": [ 4.814373779400059, 45.787384084955846 ] } }
{ "type": "Feature", "properties": { "number": 4023, "name": "Pont Masaryk", "address": "Face 45, Quai Joseph Gillet", "address2": "", "commune": "Lyon 4 ème", "nmarrond": 23, "bonus": "Non", "pole": "", "lat": 45.778172067419703, "lng": 4.81069860664111, "bike_stands": 22, "status": "OPEN", "available_bike_stands": 2, "available_bikes": 20, "availabilitycode": 1, "availability": "Vert"
{
"old_id": "movie:1111",
"title": "Vertigo",
"year": 1958,
"genre": "drama",
"summary": "Scottie Ferguson, ancien inspecteur de police, est sujet au vertige depuis qu'il a vu mourir son collègue. Elster, son ami, le charge de surveiller sa femme, Madeleine, ayant des tendances suicidaires. Amoureux de la jeune femme Scottie ne remarque pas le piège qui se trame autour de lui et dont il va être la victime... ",
"country": "USA",
"director": {
"old_id": "artist:3"
},