Skip to content

Instantly share code, notes, and snippets.


Nicolas Grégoire ngregoire

View GitHub Profile
ngregoire / .zshrc
Last active Apr 6, 2020
Efficiently open files from the CLI (using xdg-open and fasd)
View .zshrc
# Add this line to your .bashrc / .zshrc
# The 'o' script (cf below) must be in your $PATH
# 'fasd' (cf must be in your $PATH too
alias oo='fasd -a -e o'
# Now use 'oo criteria<TAB>' (iterate through matches) or simply 'oo' (list entries)
# Given that 'fasd' is a requirement, maybe have a look at the 'zz' alias
ngregoire / dl-twitter-video
Created Apr 6, 2020
Shell script downloading videos embedded in tweets
View dl-twitter-video
# If the second parameter is omitted, the video is saved to a timestamped file
if [ "$TWEET_URL" = "--help" ] || [ "$TWEET_URL" = "-h" ]
ngregoire / pdf-grep
Last active Nov 9, 2020
Grep through PDF files
View pdf-grep
# Three arguments: ROOT_DIR, PATTERN, OPTIONS
# Search below $ROOT_DIR for PDF files matching $PATTERN
# $OPTIONS is passed to pdfgrep (ex: grep-pdf . 'some words' -h -C5)
if [ -z "$1" ]; then
echo "! Argument ROOT_DIR is needed!"