Skip to content

Instantly share code, notes, and snippets.

View pejantantangguh's full-sized avatar
🎯

Herman Ng pejantantangguh

🎯
View GitHub Profile
@pejantantangguh
pejantantangguh / Swapmemory.txt
Created June 12, 2019 23:20
Swap Memory ARTICLE for low memory issues
https://medium.com/@jm_c/mysql-crashing-innodb-mmap-bytes-failed-errno-12-64d5b801b2f2
https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04#conclusion
@pejantantangguh
pejantantangguh / add-wc-order-status.php
Created June 20, 2019 01:14 — forked from bekarice/add-wc-order-status.php
Add WooCommerce 2.2 Order Status
<?php // only copy if needed!
/**
* Register new status
* Tutorial: http://www.sellwithwp.com/woocommerce-custom-order-status-2/
**/
function register_awaiting_shipment_order_status() {
register_post_status( 'wc-awaiting-shipment', array(
'label' => 'Awaiting shipment',
'public' => true,
@pejantantangguh
pejantantangguh / wc-update-bulk.php
Created June 24, 2019 05:41
Update Woocoommerce order status in bulk
add_filter ('bulk_actions-edit-shop_order','register_bulk_action');
function register_bulk_action($bulk_actions){
$bulk_actions['mark_being_processed'] = 'Mark Being Processed';
return $bulk_actions;
}
add_action ('admin_action_mark_being_processed','bulk_process_custom_status');
function bulk_process_custom_status() {
// https://dev.to/claudiodavi/reducing-vscode-memory-consumption-527k?utm_source=digest_mailer&utm_medium=email&utm_campaign=digest_email
"telemetry.enableTelemetry": false
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/.vscode": true,
"**/__pycache__": true,
"**/.pytest_cache": true,
@pejantantangguh
pejantantangguh / fbpixels.js
Last active June 30, 2019 21:58
FB Pixels customisation
https://support.google.com/tagmanager/forum/AAAAnP_FwdIRXDmZQbTITU/?hl=en&gpf=d/topic/tag-manager/RXDmZQbTITU
https://help.aitarget.com/hc/en-us/articles/228924248-How-do-I-install-the-Facebook-pixel-with-Google-Tag-Manager-
@pejantantangguh
pejantantangguh / Litespeed setup
Created July 4, 2019 08:30
Litespeed optimisation
https://wpjohnny.com/litespeed-cache-wordpress-plugin-unofficial-guide/
@pejantantangguh
pejantantangguh / importmap.sql
Created September 5, 2019 22:40
Update Row in Smart freight SQL
// Windows -< SQL Server 2014 Management
select * from importfieldmapping
select * from importfieldmapping where sourcefield = 'column ae'
update importfieldmapping set sourcefield = 'Column AE' where sourcefield = 'column ag'
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@pejantantangguh
pejantantangguh / calc.html
Created September 16, 2019 06:39
Calculator
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
@pejantantangguh
pejantantangguh / functions.php
Created March 19, 2020 04:43
Update action woocommerce
// How to change woocommece product title
remove_action('woocommerce_shop_loop_item_title','woocommerce_template_loop_product_title');
function update_inv_art_title(){
echo '<h3 class="h6 text-uppercase mb-1">' . get_the_title() . '</h3>';
}
add_action('invictus_art_loop_item_title', 'update_inv_art_title');