Instantly share code, notes, and snippets.

View gutenberg-i18n-example.php
<?php
/**
* Replace "text-domain" with your text domain, it's just the i18n load part
*/
class Gutenberg_i18n_Example {
public function hooks() {
add_action( 'enqueue_block_editor_assets', [ $this, 'scripts_register' ] );
add_action( 'enqueue_block_assets', [ $this, 'scripts_enqueue' ] );
View featured-image.js
View fix-docker-daemon.md

In case you have this stupid error. Google leads you to the following :

  1. maybe you tried this stackoverflow OWNERSHIP documentation
  2. maybe you tried this stackoverflow CONFIG Override
  3. hopefully you did not try the "uninstall / install" thing even if it's often recommanded as a "good" solution... which is not and cannot be.

Of course this can solve your case (except 3.) and I'm not saying this gist is the ultimate solution but that might be something related to a config file that just disapeared (this never happens so you probably made some mistake by copy/pasting commands).

In my case there was a problem in the /etc/systemd/system/docker.service.d folder. You have to have a file called `docker.c

View bower.md

sudo chown -R $USER:$GROUP ~/.npm && sudo chown -R $USER:$GROUP ~/.config

View dashMADicons.php
<?php
/**
* Plugin Name: Randomize Dashicons
* Description: why not ? Do you understand all icons ? Let's make it almost impossible to understand ^^
* Version: 0.73
* Author: Julien Maury
*/
defined( 'ABSPATH' )
or die( 'No' );
View github-org.sh
#!/usr/bin/env bash
# Credit : Julien maury
org=$1
curl -s https://api.github.com/orgs/${org}/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
View github.sh
#!/usr/bin/env bash
# Credit : Julien maury
username=$1
curl -s https://api.github.com/users/${username}/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
View lando.sh
#!/bin/bash
# Credit : Julien Maury 08/04/2018
# In which folder should I "lando" ?
if [ ! -d ~/Desktop/dev ]; then
echo "The folder ~/Desktop/dev does not exist, so I've created it."
mkdir -p ~/Desktop/dev
fi
cd ~/Desktop/dev
View debug-all-wp-hooks.php
<?php
/**
* Plugin name: Debug all filters and actions
* Description: This plugin is for debug only. This displays all action and filter hooks that are fired in the page (in order).
* Author: Julien Maury
* Version: cool
*/
defined( 'ABSPATH' )
or die ( '~No~' );
View pull.sh
#!/bin/bash
# Credit : Julien Maury 19/03/2018
# In which folder I have to look ?
dirr="$1"
if [ -z "$dirr" ]; then
echo "You have to specify a directory"
exit 2
fi