Skip to content

Instantly share code, notes, and snippets.

View famanson's full-sized avatar

Son Pham famanson

View GitHub Profile
@DerLobi
DerLobi / pre-commit
Last active May 9, 2022 09:45
Don't commit focused tests. Use this as a pre-commit hook and the commit won't succeed if you have staged changes that contain `fdescribe`, `fcontext`, `fit`, `fspecify` or `fexample`. Copy this file as `pre-commit` into the `.git/hooks` folder of your repository (create it if neccessary) and chmod +x the file.
#!/bin/sh
#
# This pre-commit hook looks for `fdescribe`, `fcontext`, `fit`, `fspecify` and `fexample` in the
# staged files and exits with an error code of 1 if there are such changes.
#
STATUS=0
DESCRIBEFILES=$(git diff --staged -G"^\s*fdescribe\(" --name-only | wc -l)
if [ $DESCRIBEFILES -gt 0 ]
@fprimex
fprimex / set_alert_limits.sh
Created April 28, 2014 11:08
Couchbase set_alert_limits.sh
#!/bin/sh
cbuser=Administrator
cbpassword=couchbase
cbserver=127.0.0.1
cbport=8091
# default is 50
max_overhead_perc=50
# default is 90