Skip to content

Instantly share code, notes, and snippets.

Pre-Install
AJUSTAR TIME ZONE
sudo dpkg-reconfigure tzdata
ou
# timedatectl set-timezone America/Sao_Paulo
AJUSTAR O LOCAL
# dpkg-reconfigure locales
@brunoalvarenga
brunoalvarenga / imapsync.md
Created August 10, 2023 13:22 — forked from saiful7/imapsync.md
Imapsync on Ubuntu 20.04 (lazy guide)

Imapsync on Ubuntu 20.04 (lazy guide)

sudo apt install -y libauthen-ntlm-perl libclass-load-perl libcrypt-ssleay-perl libdata-uniqid-perl libdigest-hmac-perl libdist-checkconflicts-perl libencode-imaputf7-perl libfile-copy-recursive-perl libfile-tail-perl libio-compress-perl libio-socket-inet6-perl libio-socket-ssl-perl libio-tee-perl libmail-imapclient-perl libmodule-scandeps-perl libnet-dbus-perl libnet-ssleay-perl libpar-packer-perl libreadonly-perl libregexp-common-perl libsys-meminfo-perl libterm-readkey-perl libtest-fatal-perl libtest-mock-guard-perl libtest-mockobject-perl libtest-pod-perl libtest-requires-perl libtest-simple-perl libunicode-string-perl liburi-perl libtest-nowarnings-perl libtest-deep-perl libtest-warn-perl make cpanminus && \
cd ~/ && \
git clone https://github.com/imapsync/imapsync.git && \
cd ~/imapsync/ && \
sudo ln -s ~/imapsync/imapsync /usr/bin/imapsync && \
imapsync --testslive

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@brunoalvarenga
brunoalvarenga / functions.php
Created October 7, 2016 13:30 — forked from claudiosanches/functions.php
WooCommerce - Custom tag cloud shortcode
<?php
/**
* Custom WooCommerce tag cloud shortcode.
*
* Use the follow shortcode in your pages: [my_wc_tag_cloud]
*/
function my_custom_wc_tag_cloud_shortcode() {
return wp_tag_cloud( array( 'taxonomy' => 'product_tag', 'echo' => false ) );
}
@brunoalvarenga
brunoalvarenga / functions.php
Created October 7, 2016 13:30 — forked from claudiosanches/functions.php
WooCommerce - Redirect to checkout after add product to the cart
<?php
/**
* Add to cart redirect to checkout.
*
* @param string $url
* @return string
*/
function my_wc_add_to_cart_redirect_to_checkout( $url ) {
return wc_get_checkout_url();
@brunoalvarenga
brunoalvarenga / wc-remove-billing-fields.php
Created October 7, 2016 13:29 — forked from claudiosanches/wc-remove-billing-fields.php
WooCommerce - Remove billing address, fone and company fields
<?php
/**
* Plugin Name: WooCommerce Remove billing fields
* Description: Remove billing address, fone and company fields from WooCommerce checkout.
* Author: Claudio Sanches
* Author URI: https://claudiosmweb.com
* Version: 0.0.1
* License: GPLv2 or later
*/
@brunoalvarenga
brunoalvarenga / wc-remove-billing-fields.php
Created October 7, 2016 13:29 — forked from cagartner/wc-remove-billing-fields.php
WooCommerce - Remove billing address, fone and company fields
<?php
/**
* Plugin Name: WooCommerce Remove billing fields
* Description: Remove billing address, fone and company fields from WooCommerce checkout.
* Author: Claudio Sanches
* Author URI: https://claudiosmweb.com
* Version: 0.0.1
* License: GPLv2 or later
*/
@brunoalvarenga
brunoalvarenga / functions.php
Created October 7, 2016 13:29 — forked from claudiosanches/functions.php
WooCommerce - Add Order Again button to My Orders actions
<?php
/**
* Add order again button in my orders actions.
*
* @param array $actions
* @param WC_Order $order
* @return array
*/
function cs_add_order_again_to_my_orders_actions( $actions, $order ) {
if ( $order->has_status( 'completed' ) ) {
@brunoalvarenga
brunoalvarenga / functions.php
Created October 7, 2016 13:28 — forked from fuyuko/functions.php
Cheatsheet - WooCommerce Customization in functions.php
//Add a stylesheet after default style.css
wp_enqueue_style( 'my-css', get_template_directory_uri() . 'my-css.css', array('themename-style'));
//WooCommerce - Sort products by SKU
add_filter('woocommerce_get_catalog_ordering_args', 'custom_woocommerce_catalog_orderby');
function custom_woocommerce_catalog_orderby( $args ) {
$args['meta_key'] = '_sku';
$args['orderby'] = 'meta_value';
$args['order'] = 'asc';
return $args;
@brunoalvarenga
brunoalvarenga / functions.php
Created October 7, 2016 13:23 — forked from claudiosanches/functions.php
WooCommerce - Redirect login to shop page
<?php
function custom_woocommerce_login_redirect( $url ) {
return get_permalink( wc_get_page_id( 'shop' ) );
}
add_filter( 'woocommerce_login_redirect', 'custom_woocommerce_login_redirect' );