Skip to content

Instantly share code, notes, and snippets.

Avatar

Riteru teer823

View GitHub Profile
@teer823
teer823 / update-window-timezone.config
Created Jun 12, 2020
EBExtension for Update Windows Config
View update-window-timezone.config
###################################################################################################
#### This configuration file runs a PowerShell script that modifies the Windows timezone
####
#### Original Author: @kylegalbraith
#### https://github.com/awsdocs/elastic-beanstalk-samples/blob/master/configuration-files/community-provided/instance-configuration/enable-windowsupdate-dotnet.config
#### Modifier: @teer823
###################################################################################################
files:
"c:/temp/configureTimezone.ps1":
@teer823
teer823 / woocommerce-webhook
Created Sep 7, 2021
Webhook data from Woocommerce Order
View woocommerce-webhook
{
id: 1,
parent_id: 0,
status: 'completed',
currency: 'USD',
version: '5.6.0',
prices_include_tax: false,
date_created: '2021-08-25T14:58:07',
date_modified: '2021-08-25T15:00:13',
discount_total: '0.00',
@teer823
teer823 / woocommerce-webhook-order-update.js
Last active Sep 10, 2021
WooCommerce Webhook Template - For Lambda
View woocommerce-webhook-order-update.js
const crypto = require('crypto');
function validateRequest (event) {
// GET Secret from Environment Variable
const { WC_SECRET } = process.env;
// Get Header with Hash to validate from header (event.header)
const wc_hmac_hash = event.headers ?
event.headers['X-WC-Webhook-Signature'] || event.headers['x-wc-webhook-signature']
: "";
@teer823
teer823 / woocommerce-order-update-event-sample-labmda.json
Created Sep 10, 2021
WooCommerce Webhook Event Order updated to 'completed' - For Lambda Test Event with secret "woocommerce"
View woocommerce-order-update-event-sample-labmda.json
{
"headers": {
"X-WC-Webhook-Signature": "errtu1XQr0dm48Yz3ufiVvCgrcu2kin+H7WYQQ8Y0fE="
},
"body": "{\"status\":\"completed\",\"billing\":{\"first_name\":\"Jamy\",\"last_name\":\"\",\"company\":\"\",\"address_1\":\"\",\"address_2\":\"\",\"city\":\"\",\"state\":\"\",\"postcode\":\"\",\"country\":\"\",\"email\":\"jamy@example.com\",\"phone\":\"0888889999\"},\"customer_note\":\"\",\"line_items\":[{\"id\":90,\"name\":\"่Item-1 Sample Produc\",\"product_id\":23,\"variation_id\":0,\"quantity\":1,\"tax_class\":\"\",\"subtotal\":\"200.00\",\"subtotal_tax\":\"0.00\",\"total\":\"200.00\",\"total_tax\":\"0.00\",\"taxes\":[],\"meta_data\":[],\"sku\":\"\",\"price\":200,\"parent_name\":null}]}"
}
@teer823
teer823 / index.html
Created Mar 28, 2022
Simple HTML with Vanilla Javascript show hostname
View index.html
<html>
<head>
<title>Test</title>
</head>
<body>
<span> Hostname : </span><span id="hostname">Hostname</span>
</body>
<script>
item = document.getElementById('hostname');
item.innerText = window.location.hostname