Skip to content

Instantly share code, notes, and snippets.

View e-picas's full-sized avatar

Pierre Cassat e-picas

View GitHub Profile
@e-picas
e-picas / shell-script-model.sh
Last active January 27, 2023 09:48
A Bash script model with common options (verbose, force etc) & minimal functions (error, usage etc) to use and re-use to build your own shell scripts easily.
#!/usr/bin/env bash
#
# Bash script model
#
# A Bash script model with common options (verbose, force etc)
# & minimal functions (error, usage etc)
# to use and re-use to build your own shell scripts easily.
#
# To begin, run one of the followings:
#
@e-picas
e-picas / 0_reuse_code.js
Created January 1, 2016 10:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@e-picas
e-picas / SplClassLoader.php
Last active August 29, 2015 14:15 — forked from jwage/SplClassLoader.php
The standard SplClassLoader with a failure management to let the `class_exists()` standard function work correctly (disabled by default)
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@e-picas
e-picas / git-log-tips.md
Last active August 29, 2015 13:59
GITk emulation in full git-log command line

GITk emulation in full GIT command line

One line GIT command to emulate a "gitk like" log:

git log --graph --full-history --all --color \
    --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%cN <%cE>%Creset'

The same without full history:

git log --graph --all --color \