This file contains 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
// Replace 7 with the ID of your form and 13 with the ID of the field you want to force "all required" | |
// http://www.gravityhelp.com/documentation/page/Gform_field_validation | |
add_filter("gform_field_validation_7_13", 'validate_tcs', 10, 4); | |
function validate_tcs($result, $value, $form, $field) { | |
// Convert the checkbox input name value (returned as part of "field") | |
// into the "underscored" ID version which is found in the $_POST | |
foreach ($field['inputs'] as $input) { | |
$input_post_value = 'input_' . str_replace('.', '_', $input['id']); | |
This file contains 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
for f in *.svg; do mv $f `basename $f .svg`.colors-white.svg; done; |
This file contains 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
git branch | grep "* master" && echo 'COMMIT REJECTED - you are not allowed to commit directly to the master branch you fool!' |
This file contains 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
git log --name-only --pretty=oneline --full-index SHA1..SHA2 | grep -vE '^[0-9a-f]{40} ' | sort | uniq |
This file contains 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
@include border-radius\(([0-9]+px)+\); |
This file contains 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
Form::macro('selectRangeWithDefault', function($name, $start, $end, $selected = null, $default = null, $attributes = []) | |
{ | |
if ( is_null($default) ) { | |
return Form::selectRange($name, $start, $end, $selected, $attributes); | |
} | |
$range = array_combine($range = range($start, $end), $range); | |
$range = [null => $default] + $range; | |
This file contains 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
/** | |
* Output Buffered Load Template Part | |
* loads a given template part using output buffering | |
* optionally including $data to be passed into template | |
*/ | |
function ob_load_template_part( $template_name, $data ) { | |
// Optionally provided an assoc array of data to pass to tempalte | |
// and it will be extracted into variables |
This file contains 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
/** | |
* Force GFORM Scripts inline next to Form Output | |
* | |
* force the script tags inline next to the form. This allows | |
* us to regex them out each time the form is rendered. | |
* | |
* see strip_inline_gform_scripts() function below | |
* which implements the required regex | |
*/ | |
function force_gform_inline_scripts() { |
This file contains 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
javascript:(function()%7Bdocument.querySelector('body').setAttribute('contenteditable'%2C true)%7D)() |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer