Skip to content

Instantly share code, notes, and snippets.

@mleko
mleko / commit-template.php
Created July 16, 2018 13:31
Include feature branch name in commit message
#!/usr/bin/env php
<?php
$commitMsgFile = $argv[1];
$commitMsg = file_get_contents($commitMsgFile);
if(!\in_array(substr($commitMsg, 0, 1), ["\n", "\r"], true)) {
return;
}
<?php
class Stopwatch
{
/**
* @var array[]
*/
private $marks = [];
/**
git config --global alias.broom '!git branch --merged | egrep -v "(^\*|master|dev|release/next)" | xargs git branch -d'
@mleko
mleko / color-run.sh
Last active January 15, 2022 19:50
Dry run and console color helper
#!/bin/bash
# Usage: `. color-run.sh`
# To perform dry run set `EXEC_DRY_RUN=1`
function colors {
# check if stdout is a terminal...
if test -t 1; then
# see if it supports colors...