Skip to content

Instantly share code, notes, and snippets.

View WebDevJL's full-sized avatar

Jérémie Litzler WebDevJL

View GitHub Profile
# List all folders in a given directory ($1)
# Source directory contains directories like "my dir - a description"
# We will remove it 2 steps:
# => Remove the spaces
# => Replace .-. in a simple dash.
# => See https://unix.stackexchange.com/questions/86722/how-do-i-loop-through-only-directories-in-bash
for d in $1*/ ; do
echo "current: $d"
#rename ' - ' '-' $d # doesn't work on windows, even with bash install. rename require to install through apt-get.
#rename ' ' '.' $d # doesn't work on windows, even with bash install. rename require to install through apt-get.
@WebDevJL
WebDevJL / main.js
Created July 24, 2020 11:07
Divi builder slide menu
jQuery(document).ready(function(){
var mobileNav = jQuery(".mobile_nav");
var mobileMenuBar = jQuery(".mobile_menu_bar");
jQuery(".et_mobile_menu")
.append("<li><a class=\"close-nav\" href=\"#\" aria-label=\"Fermer le menu\" title=\"Fermer le menu\">Fermer le menu</a></li>");
mobileMenuBar.click(function(event) {
var openedMenu = mobileNav.hasClass("opened");
console.log("clicked menu icon (opened: "+openedMenu+"!");
});
jQuery(".close-nav").click(function(event) {
@WebDevJL
WebDevJL / xdebug.conf
Created January 27, 2019 14:09
Xdebug configuration to add in php.ini
xdebug.remote_enable=1
xdebug.remote_connect_back=On
xdebug.remote_port="9000"
xdebug.profiler_enable=0
xdebug.remote_autostart = 1
xdebug.var_display_max_depth = 5
xdebug.var_display_max_children = 256
xdebug.var_display_max_data = 1024
@WebDevJL
WebDevJL / launch.json
Last active January 27, 2019 13:42
Visual Studio Code User settings - Debug PHP
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/app/public": "${workspaceRoot}"
@WebDevJL
WebDevJL / ubuntu.16.04-enable.http2.for.apache2.sh
Last active November 19, 2017 21:40
Ubuntu 16.04: enable http2 for Apache2
#!/bin/bash
# $1 => UNIX user as parameter
# Done and working in a Linode 1GB on Nov, 19th.
cd ~
# to enable http/2, copy these lines into /etc/apt/sources.list
su -
vim /etc/apt/sources.list
@WebDevJL
WebDevJL / create_labels.sh
Created August 25, 2016 08:52 — forked from Chompas/create_labels.sh
Bash script to create multiple Github labels at once
#!/usr/bin/env bash
# This is a modification from https://gist.github.com/omegahm/28d87a4e1411c030aa89
# Colours and convention picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
## Instructions
# Bash 4+ is needed because of associative arrays
# jq (https://stedolan.github.io/jq/)
# Create access Token from Github (https://help.github.com/articles/creating-an-access-token-for-command-line-use/) and save it under ".token" file
# Comment / Uncomment / Add, all the labels you want
@WebDevJL
WebDevJL / validation-email.txt
Created March 29, 2016 07:17
Email format validation
^[0-9?A-z0-9?]+(\.)?[0-9?A-z0-9?]+@[A-z]+\.[A-z]{3}.?[A-z]{0,3}$
You just need to push an 'empty' reference to the remote tag name:
git push origin :tagname
Or, more expressively, use the --delete option:
git push --delete origin tagname
If you also need to delete the local tag, use:
git tag -d tagname
@WebDevJL
WebDevJL / Global .gitignore
Last active January 18, 2016 08:54
Git: How to setup a Global .gitignore
https://davidwalsh.name/global-gitignore
@WebDevJL
WebDevJL / Git: reset to commit
Last active January 18, 2016 08:55
Git: reset repo to given commit
# Reset the index to the desired tree
git reset 56e05fced
# Move the branch pointer back to the previous HEAD
git reset --soft HEAD@{1}
git commit -m "Revert to 56e05fced"
# Update working copy to reflect the new commit
git reset --hard