Skip to content

Instantly share code, notes, and snippets.

View codeagencybe's full-sized avatar
🏠
Working from home

Fabio Tielen codeagencybe

🏠
Working from home
View GitHub Profile
[options]
#
# WARNING:
# If you use the Odoo Database utility to change the master password be aware
# that the formatting of this file WILL be LOST! A copy of this file named
# /etc/odoo/openerp-server.conf.template has been made in case this happens
# Note that the copy does not have any first boot changes
#-----------------------------------------------------------------------------
# Odoo Server Config File - TurnKey Linux
@codeagencybe
codeagencybe / gist:b2bb9076782d6d8ac9af66f5c4fd0e65
Created February 7, 2019 12:38
Hide other shipping methods when free shipping is available
/**
* Hide shipping rates and methods when free shipping is available.
* Updated to support WooCommerce 2.6+ Shipping Zones.
*
* Author: Fabio Tielen / Code Agency
* URL: https://codeagency.be
*
* @param array $rates Array of rates found for the package.
* @return array
*/
@codeagencybe
codeagencybe / gist:92a7e2330e33cfde022b7749569d89d7
Created September 8, 2018 10:09 — forked from teodorboev/gist:c3f125c1fd8b2b829d99672c0d686362
Wordpress MySQL table converter to InnoDB
DROP PROCEDURE IF EXISTS convertToInnodb;
DELIMITER //
CREATE PROCEDURE convertToInnodb()
BEGIN
mainloop: LOOP
SELECT TABLE_NAME INTO @convertTable FROM information_schema.TABLES
WHERE `TABLE_SCHEMA` LIKE DATABASE()
AND `ENGINE` LIKE 'MyISAM' ORDER BY TABLE_NAME LIMIT 1;
IF @convertTable IS NULL THEN
LEAVE mainloop;
@teodorboev
teodorboev / gist:c3f125c1fd8b2b829d99672c0d686362
Created September 7, 2018 09:10
Wordpress MySQL table converter to InnoDB
DROP PROCEDURE IF EXISTS convertToInnodb;
DELIMITER //
CREATE PROCEDURE convertToInnodb()
BEGIN
mainloop: LOOP
SELECT TABLE_NAME INTO @convertTable FROM information_schema.TABLES
WHERE `TABLE_SCHEMA` LIKE DATABASE()
AND `ENGINE` LIKE 'MyISAM' ORDER BY TABLE_NAME LIMIT 1;
IF @convertTable IS NULL THEN
LEAVE mainloop;
@djrmom
djrmom / custom-hooks.php
Last active July 20, 2021 15:32
facetwp show/hide labels
<?php
add_action( 'wp_footer', function() {
?>
<script>
(function($) {
if ('object' !== typeof FWP) {
return;
}
$(function() {
@codeagencybe
codeagencybe / wget.txt
Created May 2, 2018 11:50 — forked from suzannealdrich/wget.txt
wget spider cache warmer
wget --spider -o wget.log -e robots=off -r -l 5 -p -S --header="X-Bypass-Cache: 1" live-mysite.gotpantheon.com
# Options explained
# --spider: Crawl the site
# -o wget.log: Keep the log
# -e robots=off: Ignore robots.txt
# -r: specify recursive download
# -l 5: Depth to search. I.e 1 means 'crawl the homepages'.  2 means 'crawl the homepage and all pages it links to'...
# -p: get all images, etc. needed to display HTML page
# -S: print server response
@maddisondesigns
maddisondesigns / functions.php
Last active March 8, 2025 09:18
WooCommerce Custom Fields for Simple & Variable Products
/*
* Add our Custom Fields to simple products
*/
function mytheme_woo_add_custom_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
// Text Field
[options]
#
# WARNING:
# If you use the Odoo Database utility to change the master password be aware
# that the formatting of this file WILL be LOST! A copy of this file named
# /etc/odoo/openerp-server.conf.template has been made in case this happens
# Note that the copy does not have any first boot changes
#-----------------------------------------------------------------------------
# Odoo Server Config File - TurnKey Linux
@irvingpop
irvingpop / ssh_key.tf
Last active January 23, 2025 09:07
Terraform external data source example - dynamic SSH key generation
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../ssh_key_generator.sh"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"