Skip to content

Instantly share code, notes, and snippets.

@PuZZleDucK
PuZZleDucK / local-linguist.sh
Created July 23, 2017 05:00
Script to wrap the `linguist` command so it can be used on non-repositories
echo "Local Linguist (linguist for non repos)"
if git status 2> /dev/null > /dev/null; then
echo "!!! This directory is already a git repository... please use the 'linguist' command instead"
echo "!!! If this command exits unclean it will leave a git repository behind"
echo "!!! You can remove the git repository by running 'rm -Rf .git'"
else
git init 2> /dev/null > /dev/null
git add --all 2> /dev/null > /dev/null
git commit -m "local linguist auto commit" 2> /dev/null > /dev/null
linguist "$@"
@varemenos
varemenos / 1.README.md
Last active October 23, 2024 13:07
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
@XVilka
XVilka / TrueColour.md
Last active November 18, 2024 16:13
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@cbmd
cbmd / default.conf
Created December 9, 2012 21:13
nginx config - dynamic virtual hosts
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";