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
adrienjoly / git-commit-stats-csv-without-deps-and-releases.sh
Last active Sep 30, 2019
Display `git diff` stats, one line per commit
View git-commit-stats-csv-without-deps-and-releases.sh
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
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
adrienjoly / generate-html-with-colors-from-jest-test-results.sh
Created May 10, 2019
Generate HTML with colors from Jest test results
View generate-html-with-colors-from-jest-test-results.sh
#!/usr/bin/env bash
# USAGE: ./generate-html-with-colors-from-jest-test-results.sh <file_name>
# => will create:
# - <file_name>.log (with color codes)
# - <file_name>-plain.log (without color codes)
# - <file_name>.html
FILENAME=$1
@adrienjoly
adrienjoly / list-squashed-and-merged-git-branches.sh
Last active Mar 19, 2019
List local git branches that were squashed and merged to master
View list-squashed-and-merged-git-branches.sh
# 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
adrienjoly / select-time-range-from-google-location-history.sh
Last active Mar 10, 2019
Select date/time range from Google Location History JSON, using jq
View select-time-range-from-google-location-history.sh
#!/usr/bin/env bash
# First, download "Location History" from https://takeout.google.com/settings/takeout?hl=en&gl=EN&expflags
# (fr: "Historique des positions" from https://takeout.google.com/settings/takeout?hl=fr&gl=FR&expflags)
#
# => Big "Location history.json" file that looks like that:
#
# {
# "locations": [
# { "timestampMs": "1546415889121" },
@adrienjoly
adrienjoly / run-in-docker-from-git.sh
Last active May 1, 2019
Start a Node.js project in Docker, by generating a Dockerfile
View run-in-docker-from-git.sh
#!/usr/bin/env bash
# USAGE: ./run-from-git.sh https://gitlab.com/danylo.zhalkovskyy/node_app-web.git
REPO_URL="${1}" # e.g. "https://gitlab.com/danylo.zhalkovskyy/node_app-web.git"
PORT=3000
echo "Generate Dockerfile from ${REPO_URL}..."
cat > Dockerfile << CONTENTS
FROM node:10
@adrienjoly
adrienjoly / generate-qr-codes.sh
Last active Jan 21, 2019
a bash script to generate qr-codes to download an album from bandcamp
View generate-qr-codes.sh
#!/usr/bin/env bash
echo "CSV file: $1"
NB_CODES=20
URL_PREFIX="https://harissa.bandcamp.com/yum?code="
npm install qrcode
mkdir -p qrcodes
View git-pr.sh
#!/usr/bin/env bash
# inspiration: https://davidwalsh.name/pull-down-pr
# The `git pr` alias will checkout the branch associated to a given PR.
# Usage: `$ git pr 204`
git config --global --add alias.pr '!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`
View restart-docker.sh
#!/usr/bin/env bash
# Script to restart docker
# Useful to re-synchronise clocks, cf https://forums.docker.com/t/time-in-container-is-out-of-sync/16566
# Tested on macOS only.
echo "Stopping Docker containers..."
docker-compose down
echo "Stopping Docker gracefully..."
@adrienjoly
adrienjoly / free-youtube-art-track-tutorial.md
Last active Aug 19, 2018
Create a YouTube Art Track for free using HTML, CSS and ffmpeg
View free-youtube-art-track-tutorial.md

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.

Motivation

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.