Skip to content

Instantly share code, notes, and snippets.

View renshuki's full-sized avatar
💭
🇫🇷 🇯🇵 🇺🇸

Francois-Clement Brossard renshuki

💭
🇫🇷 🇯🇵 🇺🇸
View GitHub Profile
@renshuki
renshuki / usevm.md
Created October 19, 2017 08:55 — forked from fideloper/usevm.md
You should develop in a Virtual Machine

#You should do all your LAMP development in a Virtual Machine

##Here's Why:

Many of us develop on Macintoshes. There are many reasons for this, but one of them is that it's based on a Unix platform of some sort. This allows us to run common server software such as Apache, Ruby, Python and Nodejs on our Macs.

Our computers become powerful develoment machines similar to the servers our apps will eventually live on.

Sometime we start our computer only to find Apache won't start, or MySQL can't create a PID file, or we've updated to Mountain Lion and Apache needs to be reconfigured. Death!

@renshuki
renshuki / tmux_cheatsheet.md
Last active November 11, 2017 08:48 — forked from henrik/tmux_cheatsheet.markdown
Tmux Cheatsheet

Tmux Cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@renshuki
renshuki / recalculate-acf-locations.php
Last active July 7, 2023 01:15 — forked from RadGH/recalculate-acf-locations.php
Update ACF location fields (Google Map) after WP All Import CSV import (Google map update not triggered correctly) - Credits: https://support.advancedcustomfields.com/forums/topic/how-to-update-google-map-latitudelongitude-after-importing-using-address/
<?php
global $ld_recalc;
global $geolocate_api_key;
$geolocate_api_key = "YOUR_GOOGLE_GEOLOCATE_API_KEY";
$ld_recalc = array(
'posts_per_run' => 16,
'post_types' => array( 'distributor' ),
@renshuki
renshuki / decipher_morse.md
Last active March 18, 2019 13:23
Crack / Decipher Morse

Introduction

Ciphered message:

-.-- -.. --- -... .- ..- / -.. ..- / ..- .- --. / -.-- --.. .-.. -... .- ..- / --.- .--- / --.. / .-. ..- -.. -.- -..- / -... --- -.. ..-. --- / -- -.. ..- / -.-- --.. .-.. -... .. --.- ... --.- .--- ...- / ...- --.. --.- --- - .--. / -..- ..- .- .--- .- --- .. / --.- --- / .-.. -.-- --.- --- --.. .-.-.- / .. -.-- .- / ..-. -.. ..- --. / -.-- -.. --- -... .- ..- / .- ...- .- ..- .-. .- --. / ..-. -.-- .- --- / .. -.-- .- / -.- --- --.- .. .- --. / .--- .. --.. .. .- .--- / .-- -.. ...- .-- .- --. / .. -.-- .- / .-.. -.-- --.- --- .- .--- .- / .- ...- .-- --.. .--- .--- .--. / --.- --- / .-- .- - .-. ..- --.. --. .- .-.-.- / .--- --.- --- .-.. .- / .. -.-- .- --- / -.-- -.. --- -... .- ..- .--- / -- -.. ..- ...- .- --. / --.. / -.-- -.. --- -... .- ..- / -.- --- --.- -.. --- / ..-. -.-- -.. .--- .- / ...- .- ...- .-- .- ..- .--- / .-.. -.. ...- .-- --.- --- .- --. / -.-- --.. .-.. -... --.- --- .-. / .--- -... --.- - - .--- / ..-. --.- .. -.-- / -..- --.. .. ..- --.- -..

@renshuki
renshuki / reset-ckeditor-accessibility-instructions.js
Last active March 9, 2019 10:24
Reset CKEDITOR (ALT+0) keystroke using a Tampermonky/Greasemonkey script to avoid "Accessibility Instructions" to pop up
// ==UserScript==
// @name Reset CKEDITOR Accessibility Instructions (ALT+0)
// @namespace http://tampermonkey.net/
// @version 0.1
// @description If you have your Mac configured with a French keyboard CKEDITOR pops up "Accessibility Instructions" every time you try to make an "@"
// @author renshuki
// @match *
// @grant none
// ==/UserScript==
@renshuki
renshuki / delete_all_gems.md
Last active March 18, 2019 13:23
Delete all installed Ruby gems

Command to uninstall all gems in Ruby

gem list | cut -d" " -f1 | xargs gem uninstall -aIx

@renshuki
renshuki / git_changed_files_6days_ago.md
Last active March 18, 2019 13:24
Find files changed 6 days ago in GIT and show them in a pretty format

git diff --stat @{6.days.ago} --pretty=format: --name-only

@renshuki
renshuki / delete_folders_older_than_2015.md
Last active March 18, 2019 13:24
Command to delete all folders older than year 2015

find . -type d -maxdepth 1 -not -newermt 20141231 -exec rm -r "{}" \;

@renshuki
renshuki / git_delete_remote_ghost_branches.md
Last active March 18, 2019 13:26
Delete all git remote GHOST branches that doesn't want to disappear (when you do a `git branch -a`)

git remote prune origin

or

git fetch origin --prune

@renshuki
renshuki / apache_delete_html_extension.md
Last active March 18, 2019 13:27
Apache rewrite configuration to delete .html extension in web page URL
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L,QSA]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/
RewriteRule ^(.*)\.html$ $1 [R=301,L]