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
<?php | |
// Adds initial meta to each attachment | |
function add_initial_file_size_postmeta($column_name, $post_id) { | |
static $query_ran; | |
if($query_ran !== null) { | |
$all_imgs = new WP_Query(array( | |
'post_type' => 'attachment', | |
'post_status' => 'inherit', |
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
<?php | |
if(!function_exists('wc_get_products')) { | |
return; | |
} | |
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1; | |
$ordering = WC()->query->get_catalog_ordering_args(); | |
$ordering['orderby'] = array_shift(explode(' ', $ordering['orderby'])); | |
$ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby']; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>httpdfwd</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>sh</string> | |
<string>-c</string> |
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
RewriteEngine on | |
#change dev.example.com to your domain name | |
RewriteCond %{HTTP_HOST} ^(www.)?dev.example.com$ | |
RewriteCond %{REQUEST_URI} !^/current/web/ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ /current/web/$1 | |
#change dev.example.com to your domain name | |
RewriteCond %{HTTP_HOST} ^(www.)?dev.example.com$ | |
RewriteRule ^(/)?$ current/web/index.php [L] |
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
document.querySelectorAll('button[aria-label*="Hide"]').forEach(function(el, index) { | |
if(el.closest('.job-card-list__entity-lockup').querySelector('.job-card-container__company-name').innerHTML.trim() == 'Toptal') { | |
el.click(); | |
} | |
}); |
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
<?php | |
/* | |
* THE FILTER | |
* | |
*/ | |
function custom_responsive_image_sizes($sizes, $img_name, $attachment_id) { | |
$sizes = wp_get_attachment_image_sizes($attachment_id, 'original'); | |
$meta = wp_get_attachment_metadata($attachment_id); | |
$width = $meta['width']; |
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 all instances of <YOUR_USERNAME> with your local username | |
#place this file in /opt/homebrew/etc/nginx (overwrite the existing default file there) | |
user <YOUR_USERNAME> staff; | |
worker_processes 1; | |
error_log /Users/<YOUR_USERNAME>/Sites/nginx.log; | |
error_log /Users/<YOUR_USERNAME>/Sites/nginx.log notice; | |
error_log /Users/<YOUR_USERNAME>/Sites/nginx.log info; | |
error_log /Users/<YOUR_USERNAME>/Sites/nginx.log warn; |
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
.wp-video, video.wp-video-shortcode, .mejs-container, .mejs-overlay.load { | |
width: 100% !important; | |
height: 100% !important; | |
} | |
.mejs-container { | |
padding-top: 56.25%; | |
} | |
.wp-video, video.wp-video-shortcode { | |
max-width: 100% !important; | |
} |
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
find | |
var t=window.location.protocol+"//"+window.location.host+window.location.pathname+"?variant="+e.id; | |
replace with | |
var newUrlRegex=/variant=\d*/g;var newUrlExt='?variant='+e.id;if(window.location.search!=''){if(window.location.search.includes('variant=')){newUrlExt=window.location.search.replace(newUrlRegex,'variant='+e.id);}else{newUrlExt=window.location.search+'&variant='+e.id;}}var t=window.location.protocol+"//"+window.location.host+window.location.pathname+newUrlExt; |
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
<?php | |
function load_existing_product_gallery_into_acf_gallery_field($field) { | |
global $post; | |
$field['value'] = explode(',', get_post_meta($post->ID, '_product_image_gallery', true)); | |
return $field; | |
} | |
add_filter('acf/load_field/name=product_gallery', 'load_existing_product_gallery_into_acf_gallery_field'); |
NewerOlder