Skip to content

Instantly share code, notes, and snippets.

View jmfernandez's full-sized avatar

José María Fernández jmfernandez

View GitHub Profile
@dsheiko
dsheiko / post-commit
Last active March 24, 2023 21:42
Git-hook to create a tag automatically based on lately committed package.json version
#! /bin/bash
version=`git diff HEAD^..HEAD -- "$(git rev-parse --show-toplevel)"/package.json | grep -m 1 '^\+.*version' | sed -s 's/[^A-Z0-9\.\-]//g'`
if [[ ! $version =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)(\-[A-Z]+\.[0-9]+)?$ ]]; then
echo -e "Skip tag: invalid version '$version'"
exit 1
fi
git tag -a "v$version" -m "`git log -1 --format=%s`"
echo "Created a new tag, v$version"
@ipan
ipan / diff-jq.md
Created January 16, 2018 04:47
compare two JSONs with jq #json #jq
@Tblue
Tblue / mozlz4a.py
Last active April 28, 2024 12:02
MozLz4a compression/decompression utility
#!/usr/bin/env python3
# vim: sw=4 ts=4 et tw=100 cc=+1
#
####################################################################################################
# DESCRIPTION #
####################################################################################################
#
# Decompressor/compressor for files in Mozilla's "mozLz4" format. Firefox uses this file format to
# compress e. g. bookmark backups (*.jsonlz4).
#
@oguya
oguya / install-go.md
Created May 20, 2015 03:39
install go to a custom location
  • download & install go in your home dir

      mkdir ~/src
      wget "https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz"
      tar -xvf go1.4.2.linux-amd64.tar.gz
      export GOROOT="$HOME/src/go"
      export PATH="$PATH:$GOROOT/bin"
    
  • create a directory where go would download & install packages using go get