Skip to content

Instantly share code, notes, and snippets.

@summersab
summersab / orderdesk-queue.php
Last active July 30, 2018 01:05
Queuing function for Order Desk API calls
<?php
include "order-desk-api-client.php";
$executionStartTime = microtime(true);
register_shutdown_function("unlock");
$od = new OrderDesk($storeid, $apikey);
$storeid = $_SERVER['HTTP_ORDERDESK_STORE_ID'];
$apikey = $_SERVER['HTTP_ORDERDESK_API_KEY'];
$url = substr($_SERVER['PATH_INFO'],1);
<?php
/***********
* CURRENTLY NON-FUNCTIONAL - NEEDING TO MAKE SOME SERVER CHANGES
*
* I've never written an API before, so I'm sure that my extension class is
* riddled with issues and doesn't conform to proper RESTful standards.
* Nevertheless, I wanted to provide some additional API calls to the Order
* Desk API client.
*
* In addition, my API endpoint provides a queue for calls that
@summersab
summersab / CN22.twig
Created August 12, 2018 17:29
CN22 TWIG template for Order Desk
<!DOCTYPE html>
<html>
<head>
<title>{{ store_name }} CN22</title>
<link rel="stylesheet" href="{{ base_url }}/css/receipt.css">
<style>
h1,
h2,
p {
font-family: Arial, serif;
// ==UserScript==
// @name FoxyCart
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include https://admin.foxycart.com*
// @grant none
// ==/UserScript==
//
@summersab
summersab / order-desk-userscript.js
Last active September 11, 2018 05:53
Modifications to Order Desk side-menu and order number float
// ==UserScript==
// @name Order Desk
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author summersab
// @include https://app.orderdesk.me*
// @grant none
// @run-at document-body
// @updateURL https://cdn.rawgit.com/summersab/9f08f1bacbece054ab547943bea39c06/raw/91f0375de7c6fb51020d9344feacd8c6ed58a933/order-desk-userscript.js
@summersab
summersab / ups-holidays.php
Created September 11, 2018 15:26
PHP script to return a JSON object of observed UPS holidays (i.e. days they don't pick up or deliver) using https://github.com/azuyalabs/yasumi.
<?php
require 'vendor/autoload.php';
$UPS = array(
"New Year's Day",
"New Year's Day observed",
"Memorial Day",
"Independence Day observed",
"Independence Day",
"Labour Day",
@summersab
summersab / SS-Foxy-footer.js
Created November 12, 2018 16:32
SmartyStreets integration for FoxyCart
@summersab
summersab / divi_nav_switcher.js
Last active January 2, 2019 19:40
Switch the Divi Nav Style Using JS
/**
* This is a dirty, nasty script. It's vile, and this should probably be done via a WP plugin, but this was quick, and it
* seems to work for what I need. It probably has some bugs and could be more efficient, and I'm open to feedback.
* In short, this script will let you switch navigation styles for Divi-based themes by calling the switchNav function.
* There are five possible styles:
* - default
* - fullscreen
* - slide
* - centered
* - split
@summersab
summersab / gmail-reply-to-fix.js
Last active February 5, 2019 17:10
Userscript to fix Gmail's broken reply-to
// ==UserScript==
// @name Gmail Fix
// @namespace http://tampermonkey.net/
// @version 1.1.1
// @description Fix Gmail's broken reply-to; make sure to set "Run only in top frame" to "Yes" in settings
// @author summersab
// @match https://mail.google.com/*
// @grant none
// ==/UserScript==
@summersab
summersab / IAMCredentials.json
Last active March 12, 2019 04:39
Notes for getting started with bref.sh
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",