Skip to content

Instantly share code, notes, and snippets.

M500 ; reset EEPROM
G28 ; Home
M106 P0 S255 ; Set fan speed to 100%
M303 E0 S200 C8 U1 ; PID autotune extruder
M106 P0 S0 ; Turn off fan
M303 E-1 S50 C8 U1 ; PID autotune bed
M851 Z-1.0 ; Set z-offset
M503 ; Print current settings
M500 ; Save settings
@ofernandolopes
ofernandolopes / functions.php
Created April 4, 2019 15:56 — forked from luiseduardobraschi/functions.php
Disable package splitting in Dokan Pro
<?php
remove_filter( 'woocommerce_cart_shipping_packages', 'dokan_custom_split_shipping_packages' );
remove_filter( 'woocommerce_shipping_package_name', 'dokan_change_shipping_pack_name' );
remove_action( 'woocommerce_checkout_create_order_shipping_item', 'dokan_add_shipping_pack_meta' );
add_filter( 'woocommerce_shipping_methods', function($methods){
unset( $methods['dokan_vendor_shipping'] );
return $methods;
}, 11 );
<?php
//FROM
//http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/
//http://webstractions.com/wordpress/remove-recent-comments-inline-styl/
//http://wpengineer.com/1438/wordpress-header/
//https://github.com/boldperspective/Whiteboard-Framework
//REMOVE ADMIN BAR
add_filter( 'show_admin_bar', '__return_false' );
@ofernandolopes
ofernandolopes / wp-clean-admin.php
Created August 28, 2018 15:21 — forked from celsowhite/wp-clean-admin.php
Functions to clean admin dashboard menu and welcome screen.
<?php
/*---------------------
Dashboard Menu Adjustments
---------------------*/
// Only hide specific dashboard menu items on the live server.
// Show on localhost so we can control every component.
$whitelist = array('127.0.0.1','::1');
@ofernandolopes
ofernandolopes / Configuration.h
Created January 10, 2018 23:08 — forked from istepanov/Configuration.h
Marlin Anet A8 config
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@ofernandolopes
ofernandolopes / functions.php
Created November 24, 2017 01:42 — forked from fernandoacosta/functions.php
WooCommerce - Definir uma promoção para toda a loja
<?php
add_filter( 'woocommerce_product_get_sale_price', 'fa_custom_sale_price', 10, 2 );
add_filter( 'woocommerce_product_get_price', 'fa_custom_sale_price', 10, 2 );
function fa_custom_sale_price( $sale_price, $product ) {
return $product->get_regular_price() * 0.5;
}
@ofernandolopes
ofernandolopes / functions.php
Created October 16, 2017 07:16 — forked from woogist/functions.php
Autocomplete all WooCommerce orders
/**
* Auto Complete all WooCommerce orders.
*/
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
$order = wc_get_order( $order_id );
@ofernandolopes
ofernandolopes / wc-sku-sorting.php
Created August 1, 2017 12:32 — forked from bekarice/wc-sku-sorting.php
Sort WooCommerce Products by SKU
/**
* Adds the ability to sort products in the shop based on the SKU
* Can be combined with tips here to display the SKU on the shop page: https://www.skyverge.com/blog/add-information-to-woocommerce-shop-page/
*/
function sv_add_sku_sorting( $args ) {
$orderby_value = isset( $_GET['orderby'] ) ? wc_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) );
if ( 'sku' == $orderby_value ) {
@ofernandolopes
ofernandolopes / functions.php
Created March 13, 2017 19:04 — forked from claudiosanches/functions.php
WooCommerce - Adds a custom message about how long will take to delivery.
<?php
/**
* Adds a custom message about how long will take to delivery.
*/
function my_wc_custom_cart_shipping_notice() {
echo '<tr class="shipping-notice"><td colspan="2"><small>';
_e( '<strong>Atenção:</strong> O prazo de entrega começa a contar a partir da aprovação do pagamento.', 'my-text-domain' );
echo '</small></td></tr>';
}
@ofernandolopes
ofernandolopes / wp_admin_post_thumbnail_html_example.php
Created March 1, 2017 15:52 — forked from jerclarke/wp_admin_post_thumbnail_html_example.php
Demo using WP's admin_post_thumbnail_html filter to insert content in featured image metabox
<?php
/**
* Adds a detailed UI to WP's thumbnail HTML markup used in the Feature Image metabox.
*
* Adds a description of featured images, a listing of the formats used by GV and
* previews of how the images will appear in features slider and thumbnails.
*
* Note that $thumbnail_id is only saved when the post is saved. Immediately after the featured image is changed
* this value is updated, but not the postmeta field in the database (nor OUR fields which are tied to it)
* SO: