Skip to content

Instantly share code, notes, and snippets.

@cgarnier
cgarnier / MailhogTestHelper.php
Last active May 17, 2022 10:24 — forked from v-jacob/MailTestHelper.php
Mailhog PHPUnit Test Helper
<?php
use GuzzleHttp\Client;
trait MailTestHelper
{
/**
* @var \GuzzleHttp\Client
*/
protected $mailService;
@cgarnier
cgarnier / prepare-commit-msg
Last active June 5, 2017 05:36 — forked from airblade/prepare-commit-msg
Git prepare-commit-msg hook to extract issue number from branch name and append to commit message.
#!/bin/bash
# Adds reference to GitHub issue if available in branch name.
# The issue number should be at the end of the branch name, following
# a hyphen.
# Only proceed if no second parameter is given to the script.
if [ x = x${2} ]; then
branch=$(git symbolic-ref --short HEAD)
if [[ $branch =~ ^([^/]+)/([A-Z]+\-[0-9]+) ]]; then
@cgarnier
cgarnier / post-receive
Last active June 19, 2016 17:47 — forked from edmondburnett/gist:40e7db34416fdc734846
Push-to-Deploy node project
#!/usr/bin/env python
# post-receive hook for git-based deployments
import sys
import os
from subprocess import call
# configuration
deploy_to_path = os.path.realpath('./deploy_dir')
deploy_branch = 'master'
@cgarnier
cgarnier / create-startssl-cert-bundle.sh
Created December 1, 2015 14:59 — forked from david50407/create-startssl-cert-bundle.sh
Read a SSL certificate issued by StartSSL and bundle intermediate certificates into it so it works everywhere
#!/bin/bash
set -eo pipefail
cert_file="$1"
if [ -z "$cert_file" ]; then
echo "Usage: create-startssl-cert-bundle CERTIFICATE_FILE" >&2
echo >&2
echo "Bundles StartSSL's intermediate certs and writes combined certificate to stdout" >&2
exit 1