Skip to content

Instantly share code, notes, and snippets.

View ketzacoatl's full-sized avatar

Ketzacoatl ketzacoatl

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"
@dino-
dino- / string-conversions.hs
Last active May 3, 2024 08:57
A handy illustration of converting between String, Text and ByteString in Haskell
#! /usr/bin/env stack
-- stack --resolver lts-18.8 script
{-# LANGUAGE OverloadedStrings #-}
{-
This is a handy illustration of converting between five of the commonly-used
string types in Haskell (String, ByteString, lazy ByteString, Text and lazy
Text).
@dysinger
dysinger / Vagrantfile
Last active October 6, 2015 11:43
Vagrant AWS config for Haskell projects
# -*- mode: ruby -*-
# vi: set ft=ruby :
# install:
# `vagrant plugin install vagrant-aws`
# `vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box`
# config:
# `export AWS_ACCESS_KEY_ID='...'`
# `export AWS_SECRET_ACCESS_KEY='...'`
# `export AWS_REGION='us-west-2'`