Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
path=$(mktemp -d)
risk=$RISK_SCORE
if ! [ $WEBHOOK_URL ]
then
echo "You need to provide a WEBHOOK_URL."
exit 1
fi
@lluft
lluft / pre-commit
Last active October 14, 2015 21:34 — forked from holyjak/pre-commit
Git pre-commit hook that fails for changes introducing Jasmine's exclusive tests using "ddescribe" or "iit"
#!/bin/sh
# A git pre-commit hook that verifies that the change does not introduce
# the use of a Jasmine exclusive test via 'iit(..)' or 'ddescribe(..)', which would
# prevent most other tests from being run without any clear indication thereof
# Redirect output to stderr.
exec 1>&2
ADDED_EXCLUSIVE_TEST=$(git diff -U0 --staged -S"(\W|^)(ddescribe|iit))\s+?\(" --pickaxe-regex | egrep "(^\+.*(ddescribe|iit))|\+{3}")
@lluft
lluft / gist:6303820
Created August 22, 2013 06:25
all non standard searchfields sf
_.each(test,function(sobjects){ sfdc.describe(sobjects.name, function(sfObjectDescription){
var allSearchableSFObjectFields = [];
for (var i = 0; i < sfObjectDescription.fields.length; i++) {
if (sfObjectDescription.fields[i].nameField)
allSearchableSFObjectFields.push(sfObjectDescription.fields[i].name);
};
if (allSearchableSFObjectFields.length > 0 && allSearchableSFObjectFields[0]!="Name")
console.log(sfObjectDescription.name + ' namefields :'+JSON.stringify(allSearchableSFObjectFields.join(',')))