- copy the file
commit-msg
to.git/hooks/commit-msg
- make sure your delete the sample file
.git/hooks/commit-msg.sample
- Make commit msg executable.
chmod +x .git/hooks/commit-msg
- Edit
commit-msg
to better fit your development branch, commit regex and error message - Profit $$
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', true); | |
ini_set('display_startup_errors', true); | |
error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_STRICT); | |
if (function_exists('newrelic_disable_autorum')) { | |
newrelic_disable_autorum(); | |
} | |
$files = glob(__DIR__ . '/env-config/*.{json,yml}', GLOB_BRACE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run apachetop on multiple files as a result of find | |
sudo apachetop $(find /var/log/blazemeter/ -name "*access.log" -print | sed 's/^/-f '/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: create a local temp directory | |
local_action: | |
module: command mktemp -d "{{ lookup('env', 'TMPDIR') | default('/tmp/') }}ansible.XXXX" | |
register: mktemp_output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pip | |
import subprocess | |
for dist in pip.get_installed_distributions(): | |
call_str = "pip install --upgrade {0}".format(dist.project_name) | |
print "Upgrading {}".format(dist.project_name) | |
subprocess.call(call_str, shell=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
JS_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E "(.js|.es6)$") | |
if [ "$JS_FILES" = "" ]; then | |
exit 0 | |
fi | |
pass=true | |
for file in $JS_FILES; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -sL -w "%{http_code}" "http://somesite.com" -o /dev/null |
Imagine you had a Chrome/Firefox/IE? extension that can use the same keys to handle the same basic actions throughout every web page you visit.
Lets assume your are visiting google.com and search for Js Slider
. Now you want to move to the next page of results. Currently you have to click Next Page.
But what if Google implements their very own keyboard keys for their search. So they decide that if your press Ctrl+Alt+N you move to the next page. But what if Bing makes it Ctrl+Alt+P? And Yahoo makes it Cmd+Alt+N?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var gulp = require('gulp'); | |
var streamqueue = require('streamqueue'); | |
var $gulp = require('gulp-load-plugins')({ | |
lazy: false | |
}); | |
var prependBowerPath = function (package) { | |
return path.join('./src/bower_components/', package); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//to validate if a collection has all the desired keys and they are truthy: | |
var hasEvery = function(desiredKeys, collection) { | |
return _.all(desiredKeys, _.result.bind(collection, collection)); | |
}; | |
var desiredKeys = ['hello', 'there', 'isIt']; | |
var collection = { hello: 1, there: 1, isIt: true}; | |
hasEvery(desiredKeys, collection); | |
//-> true |