Skip to content

Instantly share code, notes, and snippets.

Emmanuel Pelletier Leimi

Block or report user

Report or block Leimi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Leimi /
Last active Aug 9, 2018
Easy monitor switch
# see help section below for script description
# change the four "constants" below to match your config
# this is the xrandr monitor name for the "temporary" monitors you connect often on your laptop,
# via the HDMI or VGA cable directly, for projecting on TV or whatever
# this is the xrandr monitor name of your usual external monitor you use 99% of the time
Leimi / jsonToFiles.js
Created Dec 3, 2017
Metalsmith plugin to transform one JSON array to multiple "files" in the metalsmith chain
View jsonToFiles.js
const _ = require('lodash');
const path = require('path');
* metalsmith plugin that transforms one JSON array to multiple "files" in the metalsmith chain
* A JSON file is taken by the plugin if a ".json" extension is detected + it has a "type: collection" metadata.
* Each object in the JSON array must at least have a "path" key to generate the fake file path.
* All other properties are set on the file object.
Leimi / base.html
Last active Sep 18, 2018
metalsmith-react-templates example of a custom strategy & hydrator for React Helmet server-side rendering
View base.html
<!DOCTYPE html>
<html {{htmlAttributes}}>
<!-- etc -->
<body {{bodyAttributes}}>
Leimi / index.js
Last active Sep 23, 2018
Liens youtube du topic musique electroniques
View index.js
const process = require('process');
const cheerio = require('cheerio');
const request = require('request');
const queryString = require('query-string');
const getPage = (url) =>
new Promise((resolve, reject) => {
request(url, (error, response, body) => {
Leimi /
Created May 1, 2017
Start prettier on each file change via watchexec
# Automatically pass prettier when a file changes thanks to watchexec.
# start this at the root of a js directory you want to pass prettier on file save
# recommended watchexec setup: `watchexec --postpone --exts js`
# ```
# cd ~/myproject
Leimi / gitlab-merge-requests-link-userscript.js
Last active Oct 16, 2017
Assigned merge request shortcuts in Gitlab Menu UserScript
View gitlab-merge-requests-link-userscript.js
Leimi / index.html
Last active Feb 15, 2017
View index.html
<!DOCTYPE html>
<html lang="fr">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href=""/>
<link href="" rel="stylesheet">
Leimi /
Last active Jan 24, 2017
Making Emmet work on my ST3 install

I had trouble making the Emmet plugin work on my Arch+ST3 install. Don't know if it's Arch's fault, or because my installation is starting to get really old… But here is how it worked in the end as of right now:

  • uninstall current Emmet
  • uninstall Package Control (we will reinstall it later)
  • close Sublime Text 3
  • delete all remaining Emmet folders you find in the ~/.config/sublime-text-3 and subdirectories
  • delete PyV8 folders you find in ~/.config/sublime-text-3/Packages and ~/.config/sublime-text-3/Installed Packages
  • delete all Package Control related files and folders except ~/.config/sublime-text-3/Packages/User/Package Control.sublime-settings
  • start Sublime Text 3
Leimi /
Created Dec 6, 2016
Batch svg manipulations with Inkscape
# convert all .ai files found in current folder to svg
for file in $(ls *.ai)
svg_file=$(echo "$file" | sed "s/.ai/.svg/")
inkscape --without-gui --file=$file --export-plain-svg=$svg_file
Leimi / keymap_leimi.c
Last active Aug 20, 2017
Layout GH60 RevCHN - spaceFN, ctrl on capslock, ISO missing key on fn layer
View keymap_leimi.c
#include "keymap_common.h"
/* following to flash firmware on GH60 RevCHN */
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* layer0: 60% qwerty with custom modifiers
* ESC instead of GRV, FN1 instead of LGUI, LGUI instead of LCTL, LCTL instead of CAPS, SPACEFN instead of SPACE */
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
You can’t perform that action at this time.