Skip to content

Instantly share code, notes, and snippets.

View loorlab's full-sized avatar
💻
💥👩‍🚀👨‍🚀💥

LOOR Lab loorlab

💻
💥👩‍🚀👨‍🚀💥
View GitHub Profile
@loorlab
loorlab / minifier.php
Created August 7, 2023 02:44 — forked from abranhe/minifier.php
WordPress Minifier
<?php
/**
* W3C Fix and HTML minifier
* Nobody knows how this work, so don't touch it!!!
*
* https://wordpress.stackexchange.com/a/227896/129134
* https://stackoverflow.com/a/41148695
*/

.htaccess Snippets

NOTE: .htaccess files are for people that do not have rights to edit the main server configuration file. They are intrinsically slower and more complicated than using the main config. Please see the howto in the httpd documentation for further details.

Disclaimer: While dropping the snippet into an .htaccess file is most of the time sufficient, there are cases when certain modifications might be required. Use at your own risk.

IMPORTANT: Apache 2.4 introduces a few breaking changes, most notably in access control configuration. For more information, check the upgrading document as well as this issue.

Credits

What we are doing here is mostly collecting useful snippets from all over the interwebs (for example, a good chunk is from Apache Server Configs) into one

<?php
// Trigger Holiday Mode
add_action ('init', 'bbloomer_woocommerce_holiday_mode');
// Disable Cart, Checkout, Add Cart
function bbloomer_woocommerce_holiday_mode() {
@loorlab
loorlab / functions.php
Created March 18, 2023 04:58 — forked from mrwweb/functions.php
Example Child Theme Files
<?php
/*
Important!
Make sure to replace {my_} with your theme's unique prefix.
All future functions you write should use that same prefix.
Example: mrwnten_parent_theme_enqueue_styles()
*/
add_action( 'wp_enqueue_scripts', '{my_}parent_theme_enqueue_styles' );
@loorlab
loorlab / wp-cli-shared-hosting_WP.md
Last active September 21, 2022 02:21 — forked from mklasen/Instructions.MD
Install WP-CLI on Shared Hosting (Antagonist) + Ultimate Linux Hosting With cPanel (GoDaddy)

Download WP-CLI

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Test to see if it works correctly

php wp-cli.phar --info

Add extra permissions

@loorlab
loorlab / Exiftool-Cheatsheet.md
Last active May 14, 2022 20:23 — forked from rjames86/My Exiftool Cheatsheet.md
Exiftool Cheatsheet

Last updated: 2022-05-14

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@loorlab
loorlab / gist:bf278a708fb6deebeeb4367a476838d6
Created March 24, 2022 01:22 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
<div class="form-group">
<label for="departamento"><strong>DEPARTAMENTO</strong></label>
<select class="form-control" id="departamento" name="departamento" required>
<option value = ""> </option>
<option value = "Amazonas">Amazonas</option>
<option value = "Antioquia">Antioquia</option>
<option value = "Arauca">Arauca</option>
<option value = "Atlántico">Atlántico</option>
<option value = "Bolívar">Bolívar</option>
<option value = "Boyacá">Boyacá</option>
@loorlab
loorlab / yoast_seo_breadcrumb_add_woo_shop.php
Created June 2, 2021 18:17 — forked from amboutwe/yoast_seo_breadcrumb_add_woo_shop.php
Multiple examples of how to customize the Yoast SEO breadcrumbs
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/*
* Add shop link to the Yoast SEO breadcrumbs for a WooCommerce shop page.
* Credit: https://wordpress.stackexchange.com/users/8495/rjb
* Last Tested: Apr 20 2017 using Yoast SEO 4.6 on WordPress 4.7.3
*/
add_filter( 'wpseo_breadcrumb_links', 'wpseo_breadcrumb_add_woo_shop_link' );
@loorlab
loorlab / functions.php
Created February 24, 2021 21:15 — forked from metaylimpo/functions.php
Example of wordpress theme function file for several optimizations
/*
DO NOT COPY\PASTE. Take only what you need carefully.
The following code is just a few **examples** of optimizations that you can do in functions.php file.
*/
<?php
// disable google fonts
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );