Skip to content

Instantly share code, notes, and snippets.

<?php
/*************************************************************************
* Create an RDR for every source for a shop, useful for testing.
* Bypasses duplicate check.
*
* Usage: php rdr_create.php [shop_id]
*******************************************************************************/
require 'GCI/bootstrapcli.php';
@heerdt
heerdt / checkrsa.js
Last active December 4, 2024 11:17
// by Rafael Broering de Souza, não tão bom programador, muito menos sniper no cod
function checkAvailableSpots(){
let xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.open('GET', 'https://myroadsafety.rsa.ie/api/v1/Availability/All/5a35bbab-7f79-ee11-af86-005056b9b50c/0fed074d-c2d6-e811-a2c0-005056823b22');
xhr.setRequestHeader('Accept', 'application/json, text/plain, */*');
SET @utc_offset = 6;
-- Orders Per Year --
SELECT period_date, CONCAT("UTC-", @utc_offset) AS utc_offset, order_count, gross_revenue, ROUND(gross_revenue / order_count, 2) AS gross_aov
FROM (
SELECT
COUNT(*) AS order_count,
ROUND(SUM(base_grand_total), 2) AS gross_revenue,
date_format(date_sub(o.created_at, INTERVAL @utc_offset HOUR), "%Y") AS period_date
FROM sales_order o
#!/bin/sh
# Based on Mac setup at https://mac.iamdeveloper.com
# Log file
timestamp=$(date +%s)
logFile="./my-mac-setup-$timestamp.log"
# if true is passed in, things will reinstall
reinstall=$1