Skip to content

Instantly share code, notes, and snippets.

View keiraarts's full-sized avatar
🍊

Keira Climson keiraarts

🍊
View GitHub Profile
<script>
document.addEventListener("DOMContentLoaded", initializeOnSiteJavascript);
function initializeOnSiteJavascript() {
// Track viewed products
const productId = "{{ product.id }}";
const productTitle = "{{ product.title }}";
const productHandle = "{{ product.handle }}";
const marketId = "{{ localization.market.id }}";
const trackViewedProducts = () => {
{"version":1,"resource":"file:///Users/keiraclimson/Developer/viaglamour/apps/order-editing-staging/shopify.app.toml","entries":[{"id":"UXwe.toml","timestamp":1740085416567},{"id":"zW6p.toml","timestamp":1740085428069},{"id":"FKFP.toml","timestamp":1740091160307},{"id":"pli8.toml","timestamp":1740092582552}]}
const HOSTNAME = "iricocanada.com";
const COOKIE_NAME = "__bentocore";
const NAME = "bentocore";
function getCookie(request, name) {
let result = "";
const cookieString = request.headers.get("Cookie");
if (cookieString) {
const cookies = cookieString.split(";");
cookies.forEach((cookie) => {
@keiraarts
keiraarts / 53.json
Last active November 10, 2018 18:57
sdf
{
"data":[
{
"Tiger Nixon",
"System Architect",
"Edinburgh",
61,
"2011/04/25",
"$320,800"
},
// Original Way
add_action('init', function() {
$host = $_SERVER['REQUEST_URI'];
$directory = explode('/', $_SERVER['REQUEST_URI']);
define('WOOCOMMERCE_CHECKOUT', true);
$load = locate_template('woocommerce/checkout-themeA.php', true);
if ($load) {
.coupon {
display: none!important;
}
article.post .post-meta .date {
margin-bottom: 0px;
}
article.post .post-meta .date {
padding-bottom: 0px;
border-bottom: 0px!important;
@keiraarts
keiraarts / fly.io
Last active August 24, 2018 20:49
Broken HTML rewrites
import proxy from "@fly/proxy"
import { forceSSL } from './lib/utilities'
const origin = proxy("https://viaglamour.com/")
/**
* Rewrite the path to /store/<hostname>
*/
function rewriteRequest(req) {
const url = new URL(req.url)
let path = "/store/" + url.hostname.replace(/\.[a-z]+/, '')
@keiraarts
keiraarts / ngix
Last active August 7, 2018 16:37
NGIX Custom Domains
#www.ashley.com -> https://viaglamour.com/ashley while displaying https://www.ashley.com URL
server {
# catch all for domains forwarded to site that don't qualify for other server blocks.
listen 80 default_server;
# get the domain name without extension to determine URL path later.
# regex: ^(.*?www\.)(?<domain>.+)?(.*?)(.*)\.
# test it on https://regex101.com/r/0GFSyj/1
@keiraarts
keiraarts / wp_remote_post.php
Created July 20, 2018 18:32
wp_remote_post 403 Forbidden Fix.
$headers = array(
'User-Agent' => 'Stripe Connect'
);
$response = wp_remote_post( $endpoint, array(
'headers' => $headers,
'body' => http_build_query( $data ),
)
);
/*Afghanistan*/
'AF' =>
/*Aland Islands*/
'AX' =>
/*Albania*/
'AL' =>
/*Algeria*/
'DZ' =>
/*American Samoa*/
'AS' =>