Skip to content

Instantly share code, notes, and snippets.

🎱
Focusing

Julien Maury jmau111

View GitHub Profile
@jmau111
jmau111 / alias-stack-local.md
Last active Mar 17, 2019
Linux : alias start|stop|restart Apache, Mysql, Elasticsearch, Redis
View alias-stack-local.md

Open ~/.bashrc :

sudo nano ~/.bashrc

and insert :

@jmau111
jmau111 / ePubToMobiKindle.md
Created Mar 3, 2019
Install and set kindlegen on Linux to generate .mobi files for your Kindle
View ePubToMobiKindle.md
  1. Go here and download your archive (depending on your operating system)
  2. extract the folder e.g at the root of your path "~/"
  3. open terminal and enter :

cd ~/kindlegen

then you can run :

kindlegen /PATH/TO/youEpub.epub

@jmau111
jmau111 / remove-noto.php
Created Jan 26, 2019
WordPress - Gutenberg - dequeue the default editor font Noto Serif
View remove-noto.php
<?php
add_action( 'wp_enqueue_scripts', 'jmau_remove_noto_from_frontend' );
function jmau_remove_noto_from_frontend() {
global $wp_styles;
$wp_styles->remove( 'wp-editor-font' );
}
@jmau111
jmau111 / gutenberg-i18n-example.php
Last active Dec 9, 2018
Gutenberg i18n : example in real life
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' ] );
@jmau111
jmau111 / featured-image.js
Created Dec 8, 2018
Get featured image object in Gutenberg WordPress
View featured-image.js
@jmau111
jmau111 / fix-docker-daemon.md
Created Sep 23, 2018
Cannot connect to the Docker daemon at unix:///var/run/docker.sock
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

@jmau111
jmau111 / bower.md
Created Aug 10, 2018
Bower, fix error permission denied
View bower.md

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

@jmau111
jmau111 / dashMADicons.php
Created Jun 23, 2018
Dashicons going crazy (⊙_◎)
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' );
@jmau111
jmau111 / github-org.sh
Last active Jun 23, 2018
Clone all repos for an GitHub organization
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"]} ]}'
@jmau111
jmau111 / github.sh
Last active Jun 23, 2018
Clone all repos from a GitHub account
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"]} ]}'
You can’t perform that action at this time.