Skip to content

Instantly share code, notes, and snippets.

View mrpandat's full-sized avatar
🍜
NomNomNom

KagXaef mrpandat

🍜
NomNomNom
View GitHub Profile
[alias]
co = checkout
br = branch
cm = commit -m
st = status
rsh = reset --soft HEAD^1
rhh = reset --hard HEAD
pushf = push --force-with-lease
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
rcm = "!f() { \
import boto3
from datetime import datetime, timedelta
def handle(event, context):
SOURCE_BUCKET = 'from-bucket'
DESTINATION_BUCKET = 'source-bucket'
session = boto3.session.Session()
@mrpandat
mrpandat / emergency.sh
Created April 24, 2020 23:59
emergency rasp temperature
#!/bin/bash
# Récupération de la température ; on obtient ici une valeur à 5 chiffres sans virgules (ex: 44123) :
TEMP=$(cat /sys/class/thermal/thermal_zone0/temp)
# On divise alors la valeur obtenue par 1000, pour obtenir un résultat avec deux chiffres seulement (ex: 44) :
TEMP=$(($TEMP/1000))
# Récupération de la date et l'heure du jour ; on obtient ici une valeur telle que "mercredi 31 décembre 2014, 00:15:01" :
DATE=`date +"%A %d %B %Y, %H:%M:%S"`
@mrpandat
mrpandat / prepare-commit-msg
Created October 1, 2019 13:01
Git Hook with branch commit
#!/bin/bash
# Include any branches for which you wish to disable this script
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=()
fi
# Get the current branch name and check if it is excluded
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_EXCLUDED=$(printf "%s\n" "${BRANCHES_TO_SKIP[@]}" | grep -c "^$BRANCH_NAME$")

Keybase proof

I hereby claim:

  • I am mrpandat on github.
  • I am mrpandat (https://keybase.io/mrpandat) on keybase.
  • I have a public key ASBs2_JSqIZvmu2E3GtofPoq5E9F6GUfdtXvuAYsWutpnwo

To claim this, I am signing this object: