Skip to content

Instantly share code, notes, and snippets.

View PhilippeCarphin's full-sized avatar

Philippe Carphin PhilippeCarphin

View GitHub Profile
@PhilippeCarphin
PhilippeCarphin / simple_git_ps1_example.sh
Last active December 15, 2021 01:34
Example use of git-prompt.sh with some nice features
#!/bin/bash
# Download the official git-prompt.sh with
# wget https://raw.githubusercontent.com/git/git/v$(git --version | awk '{print $3}')/contrib/completion/git-prompt.sh -O ~/.git-prompt.sh
# Gives the __git_ps1 function used in __my_git_ps1
source ~/.git-prompt.sh
GIT_PS1_SHOWUNTRACKEDFILES=true
GIT_PS1_SHOWUPSTREAM=verbose
GIT_PS1_SHOWCOLORHINTS=true
function setSumOfDatumDurationsPerMusicExpression(tokens) {
let areSummingDatumDurations = false
let sumOfDatumDurations
let indexOfOpenMusicExpr
let numExprFlags
let numExprDots
for (let i = deepestDepth; i >= 0; i--) {
tokens.forEach((token, j) => {
if(token.depth === i+1 && areSummingDatumDurations && token.type === 'OPEN_MUSIC_EXPR'){
sumOfDatumDurations += token.duration

Basic operation

A “package” would be something that has ./bin, ./lib, ./opt directories. These names are optional and are only used here to help us know what’s what. They could have been ‘foo’ and ‘bar’ but I refuse to use such identifiers.

/Users/pcarphin/storage/AnApplication/
├── bin
│   └── an_application_bin
├── lib
@PhilippeCarphin
PhilippeCarphin / tmux_local_install.sh
Last active March 24, 2020 12:02 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/.local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# However, you might want to customize the following variables:
# exit on error
set -e