Skip to content

Instantly share code, notes, and snippets.

Adrien Joly adrienjoly

Block or report user

Report or block adrienjoly

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
adrienjoly /
Last active Sep 30, 2019
Display `git diff` stats, one line per commit
git log --pretty=format:"@%ad ~~%s~~" --date=short --shortstat \
| tr "\n" " " \
| tr "@" "\n" \
| grep -v 'skip ci' \
| grep -v 'deps' \
| grep -v 'dependencies' \
| sed -En 's/ ~~.*~~ /,/p'
adrienjoly / extract-metadata-from-facebook-note-page.js
Created Jul 26, 2019
A script to paste into the js console of a Facebook note (i.e. blog post) in order to extract its meta-data
View extract-metadata-from-facebook-note-page.js
// copy and paste that script in the js console, from a facebook "note" url
permalink = $$('.mts a')[0];
[_, monthName, day, year] = new Date(permalink.innerText.split(' at ')[0]).toString().split(' ');
monthNum = {
Jan: 0,
Feb: 1,
Mar: 2,
Apr: 3,
May: 4,
adrienjoly /
Created May 10, 2019
Generate HTML with colors from Jest test results
#!/usr/bin/env bash
# USAGE: ./ <file_name>
# => will create:
# - <file_name>.log (with color codes)
# - <file_name>-plain.log (without color codes)
# - <file_name>.html
adrienjoly /
Last active Mar 19, 2019
List local git branches that were squashed and merged to master
# List local branches that were squashed and merged to master
$ comm -1 -2 \
<(git remote prune origin --dry-run | sed "s/^.*origin\///g") \
<(git branch | sed "s/^..//") \
| sed "/^$/d"
adrienjoly /
Last active Mar 10, 2019
Select date/time range from Google Location History JSON, using jq
#!/usr/bin/env bash
# First, download "Location History" from
# (fr: "Historique des positions" from
# => Big "Location history.json" file that looks like that:
# {
# "locations": [
# { "timestampMs": "1546415889121" },
adrienjoly /
Last active May 1, 2019
Start a Node.js project in Docker, by generating a Dockerfile
#!/usr/bin/env bash
# USAGE: ./
REPO_URL="${1}" # e.g. ""
echo "Generate Dockerfile from ${REPO_URL}..."
cat > Dockerfile << CONTENTS
FROM node:10
adrienjoly /
Last active Jan 21, 2019
a bash script to generate qr-codes to download an album from bandcamp
#!/usr/bin/env bash
echo "CSV file: $1"
npm install qrcode
mkdir -p qrcodes
#!/usr/bin/env bash
# inspiration:
# The `git pr` alias will checkout the branch associated to a given PR.
# Usage: `$ git pr 204`
git config --global --add '!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f'
# The `git pr-clean` alias will delete all the `pr/*` branches kept locally.
# Usage: `$ git pr-clean`
#!/usr/bin/env bash
# Script to restart docker
# Useful to re-synchronise clocks, cf
# Tested on macOS only.
echo "Stopping Docker containers..."
docker-compose down
echo "Stopping Docker gracefully..."
adrienjoly /
Last active Aug 19, 2018
Create a YouTube Art Track for free using HTML, CSS and ffmpeg

Create a YouTube Art Track using HTML, CSS and ffmpeg

This may be more of a recipe than a tutorial, but let me just share the steps I followed to generate YouTube Art Track for my band, using intermediate computer skills.


As a musician, sharing your music on YouTube is a must. But YouTube is a video platform, and making a music video to go with a song can be costly and time consuming. Several web services propose to generate a nice looking video out of your MP3 file, and to upload the result directly to your YouTube account, but this would cost you $30 per song in HD quality.

Expected output

You can’t perform that action at this time.