Skip to content

Instantly share code, notes, and snippets.

View senorihl's full-sized avatar

Rodolphe Renaux senorihl

View GitHub Profile
@senorihl
senorihl / README.md
Last active March 31, 2022 07:48
Clean local branches pushed & deleted on remote

Bash script to clean local branches which are pushed & deleted on remote

Installation

wget https://gist.githubusercontent.com/senorihl/22ee7018e0c167f994f2e75918de5166/raw/clean-local-branch.sh -O $HOME/.clean-local-branch.sh
chmod a+x $HOME/.clean-local-branch.sh
git config --global alias.clean-local '!bash $HOME/.clean-local-branch.sh'
@senorihl
senorihl / README.md
Last active November 24, 2023 09:43
Clean and rebuild local staging branches

Bash script to clean & rebuild local staging branches

Installation

wget https://gist.githubusercontent.com/senorihl/637430191235b5362a27a8c785f9623c/raw/03c206bb0c8cecaff50325dfd170d913d1d97f6e/clean-staging-branch.sh -O $HOME/.clean-staging-branch.sh
chmod a+x $HOME/.clean-staging-branch.sh
git config --global alias.clean-staging '!bash $HOME/.clean-staging-branch.sh'
[alias]
last = !bash -c 'git log --oneline -${1:-1}' -
amend = commit --amend --no-edit -a
co = checkout
cn = checkout -n
fp = fetch -p
cam = commit -am
p = !git push origin $(git rev-parse --abbrev-ref HEAD)
@senorihl
senorihl / role-playing-desktop-game.md
Last active February 16, 2019 11:58
Project Ideas

Role Playing Desktop Game

This project would consist on a desktop app built with electron which players wan join game room (with a code ?) and follow game activity such as life points 🖤, currency 💲 and object possessed 🎒.

Main functionalities

Any player lauching the app must declare (at least) a username, later he can either creates a room or join one with a code. The creator can declare a Game Master 👑 who can modify all users' caracteristics. Each game is saved asynchronously for each client, so any person can re-launch the game, with its own saving state. If another player join with db modification made later it will be sync with all client.

@senorihl
senorihl / portainer.sh
Last active July 10, 2022 16:00
Simple local portainer container
set -eux; \
docker volume create portainer_data ;\
portainer_pass=$(docker run --rm httpd:2.4-alpine htpasswd -nbB admin "pass" | cut -d ":" -f 2) ;\
docker run -d -p 1337:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer-ce:latest --admin-password="$portainer_pass"
@senorihl
senorihl / .bashrc
Last active March 30, 2022 06:30
Awesome Git PS1
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo " [${BRANCH}${STAT}]"
else
echo ""
fi