Skip to content

Instantly share code, notes, and snippets.

View czj's full-sized avatar

Clément Joubert czj

View GitHub Profile
@czj
czj / ydl.sh
Last active September 11, 2018 16:20
Download any YouTube video, channel or playlist using youtube-dl
#!/usr/bin/env bash
# Download a file from a given url
if [ -z "$1" ]; then
echo "Download a video."
echo "Usage: ydl \"url\""
else
youtube-dl --get-filename -o '%(title)s.%(ext)s' --restrict-filenames --yes-playlist --no-mark-watched --all-formats -f 'best[ext=mp4]/best' "$1"
fi
@czj
czj / Compte-rendus.md
Last active April 3, 2017 08:51
Rénovation de notre quartier : comptes rendus du travail de janvier à mars
@czj
czj / french_popular_words.js
Last active March 23, 2017 12:20
~ 2000 most popular french language words (noums, adjectives, verbs)
@czj
czj / ua.txt
Created March 9, 2017 15:19
Facebook browser's weird iOS User Agent
Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13F69 [FBAN/FBIOS;FBAV/60.0.0.37.141;FBBV/34183777;FBRV/34183777;FBDV/iPhone8,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/9.3.2;FBSS/2;FBCR/Telekom.de;FBID/phone;FBLC/de_DE;FBOP/5]
@czj
czj / crontab.sh
Last active January 15, 2017 18:22
Running Rails 5.0.1 rake tasks without depreciation messages in cron
# This triple redirection allows filtering STDERR by removing depreciation messages
# The second grep allows removing empty lines (which might trigger an email on some server)
cd /home/appname/www/current && (RAILS_ENV=production bundle exec rake myapp:mytask 3>&1 1>&2 2>&3 | grep -v 'is deprecated' ) 3>&1 1>&2 2>&3 | grep -v ''
# You can also log STDOUT to a log file
cd /home/appname/www/current && ((RAILS_ENV=production bundle exec rake myapp:mytask 3>&1 1>&2 2>&3 | grep -v 'is deprecated' ) 3>&1 1>&2 2>&3 | grep -v '') >> /home/appname/www/shared/log/taskoutput.log
set -x BROWSER "/Applications/Firefox.app/Contents/MacOS/firefox-bin"
set -x EDITOR "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -w"
set -x RUBY_CONFIGURE_OPTS "--with-jemalloc"
status --is-interactive; and source (rbenv init -|psub)
alias atom="/Applications/Atom.app/Contents/Resources/app/atom.sh"
alias buuc="brew update; and brew upgrade --cleanup"
alias ddb="make download_db"
alias df='df -h'
@czj
czj / solano.yml
Created December 13, 2016 20:05
Solano CI sample Ruby + Rails + PostgreSQL configuration
ruby_version: ruby-2.3.3p222
bundler_version: 1.13.6
# hooks:
# worker_setup: bundle exec rake db:setup # Runs once for each worker to do, e.g., database setup
# post_setup: bundle exec rake assets:precompile # Runs once before tests and after worker_setup
# post_build: bundle exec rake heroku:deploy # Runs once after entire build completes
postgresql:
version: '9.4'
@czj
czj / assurance-auto-souscription-facile.md
Last active September 13, 2016 07:59
Comment bien gérer la souscription d'un contrat d'assurance auto
  • Ajout dans "mon compte" du devis même si réalisé sur comparateur de prix
  • Auto-création du compte même si devis réalisé sur comparateur de prix
  • Auto-résiliation du contrat précédent avec remplissage automatique de l'adresse de l'ancien assureur d'après son nom
  • Remplissage automatique du code BIC d'après ton IBAN
  • Remplissage automatique des informations voiture d'après numéro d'immatriculation.
  • Signature en ligne du contrat d'assurance auto ET du mandat de prélèvement
  • Ticket CB par mail en PDF de ton paiement d'assurance temporaire
  • Upload drag & drop pour déposer les scans de tes justificatifs d'assurance passée & de carte grise
  • Documents PDF à nom de fichier explicites, et directement attachés aux emails
@czj
czj / assurance-auto-souscription-facile.md
Created September 13, 2016 07:52
Comment bien gérer la souscription d'un contrat d'assurance auto

• Autofill de tes informations d'après ton numéro de plaque d'immatriculation. • Autofill du code BIC d'après ton IBAN • Autofill de l'adresse de ton ancienne assurance auto d'après son nom (pour résilier pour toi) • Auto-résiliation du contrat précédent • Signature en ligne du contrat d'assurance auto ET du mandat de prélèvement • Auto-création d'un compte sans prise de tête • Auto association de ton devis demandé à pétarouchnok avec ton compte client existant et/ou nouvellement créé (lié via email) comme chez Amaguiz • Upload drag & drop pour déposer les scans de tes justificatifs d'assurance passée & de carte grise • Ticket CB par mail en PDF de ton paiement d'assurance temporaire