Skip to content

Instantly share code, notes, and snippets.

View filipegiacomo's full-sized avatar
🌴
On vacation

Filipe Giácomo filipegiacomo

🌴
On vacation
View GitHub Profile
@filipegiacomo
filipegiacomo / change_instance.sh
Created July 15, 2024 14:20 — forked from miglen/change_instance.sh
Easily change instance types on AWS EC2 with a bash script
#!/bin/bash
# Nico Snyman, [email protected], 14/05/2015
# Change an instance type, while keeping snapshots
# This script will stop an instance identified by instance ID,
# take snapshots of all atached volumes, and restart it
# Use:
# -i instance ID - REQUIRED - stored in instance_id
# -t instance new instance type - REQUIRED - stored in instance_type
# -s if set to 0, no snapshot will be taken, dafault is 1
# (take snapshot of attached volumes) - stored in snapshot
@filipegiacomo
filipegiacomo / cart.ajax.php
Created April 3, 2020 19:16 — forked from rafhaelhp/cart.ajax.php
Correção para calculo de frete no carrinho WC
//CART SHIPMENT CALCULATE TO HIT CEP
case 'cart_shipment':
$CartTotal = 0;
$HeightTotal = 0;
$WidthTotal = 0;
$DepthTotal = 0;
$WeightTotal = 0;
$AmountTotal = 0;
foreach ($_SESSION['wc_order'] as $ItemId => $ItemAmount):
$Read->ExeRead(DB_PDT, "WHERE pdt_id = (SELECT pdt_id FROM " . DB_PDT_STOCK . " WHERE stock_id = :id)", "id={$ItemId}");