Skip to content

Instantly share code, notes, and snippets.

@bnd5k
bnd5k / PreCommitHook
Created May 23, 2018 15:18
An example of a pre-commit hook that ensure's nothing too silly get's saved to git history.
#!/bin/bash
debug=`git diff --cached | grep -C 2 -E '+\s*(And (open|show me the page)|pry)'`
debugger=`git diff --cached | grep -C 2 debugger`
console_log=`git diff --cached | grep -C 2 console.log`
conflicts=`git diff --cached | grep -C 2 -E '<<<|>>>'`
if [ -n "$debug" ]; then
echo "debugging statements added in this commit"
echo $debug
{
'domain_name' : 'example.com'
'domainr' : {
'one_year' : {
price: '$100.00'
}
},
'some_other_registrar' : {
$.fn.S3Uploader = function(options) {
var $uploadForm, $wrapping_form, build_content_object, build_relativePath, cleaned_filename, current_files, forms_for_submit, has_relativePath, setUploadForm, settings;
if (this.length > 1) {
this.each(function() {
return $(this).S3Uploader(options);
});
return this;
}
$uploadForm = this;
settings = {
@bnd5k
bnd5k / gist:6273131
Created August 19, 2013 19:38
RSpec failure
1) Profile::LoadProfile loads a profile
Failure/Error: user = Factory.create_user!
TypeError:
can't convert nil into Array
# ./spec/factories.rb:323:in `create_user!'
# ./spec/profile/contexts/load_profile_spec.rb:6:in `block (2 levels) in <top (required)>'
@bnd5k
bnd5k / boostrap_script
Created October 8, 2012 16:19
Script for autogenerating user and password MySql
#!/bin/sh
# vim: se ft=sh ts=2 sw=2:
#
set -e
echo ""
echo " Hello"
echo ""