Skip to content

Instantly share code, notes, and snippets.

View alancpazetto's full-sized avatar
🏋️
Front-End @ Stone Co.

Alan Pazetto alancpazetto

🏋️
Front-End @ Stone Co.
View GitHub Profile
function isChatMessage(message) {
if (message.__x_isSentByMe) {
return false;
}
if (message.__x_isNotification) {
return false;
}
if (!message.__x_isUserCreatedType) {
return false;
}
@alancpazetto
alancpazetto / remove blank lines regex.md
Created February 22, 2018 14:09 — forked from fomightez/remove blank lines regex.md
remove all blank lines using regular expressions
@alancpazetto
alancpazetto / woocommerce-custom-cart-item-data.php
Created November 24, 2017 19:45 — forked from RadGH/woocommerce-custom-cart-item-data.php
Get and set custom cart item/product information prior to WooCommerce checkout, and carry those valus over to Order Item Metadata.
<?php
// UPDATE: Stefan from Stack Overflow has explained a better way to handle cart item data.
// See http://stackoverflow.com/a/32327810/470480
// ----------------------
/*
Instructions:
@alancpazetto
alancpazetto / add-woocommerce-product.php
Created November 23, 2017 13:42 — forked from Yame-/add-woocommerce-product.php
Adding a WooCommerce product programmatically.
<?php
$args = array(
'post_author' => 1,
'post_content' => '',
'post_status' => "draft", // (Draft | Pending | Publish)
'post_title' => '',
'post_parent' => '',
'post_type' => "product"
);
@alancpazetto
alancpazetto / _verify-repair-permissions-disk.md
Created May 3, 2017 21:54 — forked from bzerangue/_verify-repair-permissions-disk.md
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /