Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am willgopublic on github.
  • I am willgopublic (https://keybase.io/willgopublic) on keybase.
  • I have a public key ASCEPi_t4X3hZFi7HXU48FucEEtIBcpYIgYFbqrRWRCRfQo

To claim this, I am signing this object:

# Clone repo
git clone https://github.com/prerender/prerender.git
cd prerender
npm install
npm install prerender-redis-cache --save
# Modifi .htaccess (Middleware in prerender vocabulary
https://gist.github.com/thoop/8072354
# Open firewall port
@willgopublic
willgopublic / pre-commit
Created January 12, 2017 08:35 — forked from zushane/pre-commit
A git pre-commit hook to run phpunit tests, written in bash. Features pretty colours, and slightly individualized output.
#!/bin/bash
# Locate our phpunit.
phpunit=`which phpunit`
# Any extra arguments to phpunit should go here.
phpunit_args=""
# Define a location to save the output.
outputlog="/tmp/phpunit_output_`date +%s`.log"
@willgopublic
willgopublic / post-merge
Created January 4, 2017 10:04 — forked from ivoba/post-merge
post-merge hook for composer php apps
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
# phponly by Ivo Bathke ;)
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
@willgopublic
willgopublic / post-update
Created January 4, 2017 10:04 — forked from six0h/post-update
Git Post-Update hook that checks for changes to composer.lock, and fires a composer install if required.
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""A post-update Git hook to execute `composer install` when composer.json changes
:Author: Cody Halovich
:Company: HootSuite Media Inc.
"""
import subprocess
@willgopublic
willgopublic / post-receive
Created January 4, 2017 10:04
git post-merge hook : update / install composer packages & composer itself
#!/bin/bash
# thanks http://www.jenssegers.be/blog/46/deploying-websites-with-git-and-composer-
# replace folder
cd "`dirname $0`/../../application/config"
# Check if a composer.json file is present
if [ -f composer.json ]; then
@willgopublic
willgopublic / post-rewrite
Created January 4, 2017 10:04 — forked from digitaljhelms/post-rewrite
Git hook to call `bower install` and `npm install` automatically.
#!/bin/sh
echo "[post-rewrite hook: $1]"
# by noahgrant & digitaljhelms
#
# quick script to call "bower install" and "npm install" automatically if
# bower.json or package.json are changed, respectively
#
# this assumes one top-level file for each
@willgopublic
willgopublic / post-merge
Created January 4, 2017 10:04 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@willgopublic
willgopublic / post-receive-laravel.php
Created October 27, 2016 20:04 — forked from ryansechrest/post-receive-laravel.php
Git post-receive hook to deploy a Laravel application.
#!/bin/bash
# Created on 7/17/13 by Ryan Sechrest
# Deploys pushed branch from the origin repository to the web directory
if [[ (-n $1) && (-n $2) && (-n $3) ]]; then
# Set path to project directory
project_path="/var/www/domains/$2/$3"
@willgopublic
willgopublic / post-merge.sh
Created April 1, 2016 11:18 — forked from alonisser/post-merge.sh
git hook for bower install and npm install on bower.json/package.json change
#!/bin/sh
#Inspired by https://gist.github.com/jbergantine/3870080
#Since every `git pull` is actually a merge. We can use it to automaticly run basic Django tasks after pulling from the upstream master branch (or any other)
#Notice: This won't run at git fetch. since fetch doesn't merge anything
#Installation:
# copy this script with the name:`post-merge.sh` to your project root folder
# symlink it to the ./git/hooks/post-merge: `ln post-merge.sh .git/hooks/post-merge
#You should have bash (windows users, means cygwin/mingw anything that works for you
#Based on the instructions here: https://oknesset-devel.readthedocs.org/en/latest/workflow.html#before-coding