Skip to content

Instantly share code, notes, and snippets.

initial_folder="." # You can use "." to target the folder in which you are running the script for example
all_images=$(find -E $initial_folder -iregex ".*\.(jpg|gif|png|jpeg|tiff)")
while read -r image_full_path; do
filename=$(basename "$image_full_path");
source_folder=$(dirname "$image_full_path");
destination_folder=$source_folder;
destination_full_path=$destination_folder"/"$filename;
<<< "$destination_full_path"
@OatmealBath
OatmealBath / gist:5929c167091b3e00909e
Created February 17, 2015 13:41
Active Links jQuery
// Add active class to links to current page
jQuery(document).ready(function(){
console.log(document.location);
jQuery('a[href="'+document.location.href+'"]').addClass('active');
jQuery('a[href="'+document.location.origin+document.location.pathname+'"]').addClass('active');
jQuery('a[href="'+document.location.pathname+'"]').addClass('active');
})
@OatmealBath
OatmealBath / gist:805cfe4d6524004dc56b
Last active August 29, 2015 14:06
Redirect Gravity Forms to Wordpress page by id
// in functions.php
add_filter("gform_confirmation", "custom_confirmation", 10, 4);
function custom_confirmation($confirmation, $form, $lead, $ajax){
if($form["id"] == "1"){
$confirmation = array("redirect" =>get_page_link(191));
}
else if($form["id"] == "2"){
$confirmation = array("redirect" =>get_page_link(191));
// DEFINE FUNCTION TO KEEP TWO COLUMNS THE SAME HEIGHT
function matchColumnHeight(divone, divtwo, debug){
if(jQuery(divone).length > 0 && jQuery(divtwo).length > 0){
if(debug){
console.log("Div One Original Height: "+jQuery(divone).outerHeight());
console.log("Div Two Original Height: "+jQuery(divtwo).outerHeight());
}
if(jQuery(divone).outerHeight() > jQuery(divtwo).outerHeight()){
jQuery(divtwo).css('min-height',jQuery(divone).outerHeight());
} else {