Skip to content

Instantly share code, notes, and snippets.

View nocrates's full-sized avatar

Eric Sexton nocrates

  • Studio Science
  • Snohomish, WA
View GitHub Profile
import requests
import json
import uuid
# Some identifiers for ONE particular store and product
# Replace for your own testing
class GuestShopper:
def __init__(self):
@nocrates
nocrates / fetchCommerceUrl.js
Last active July 13, 2025 13:06
From B2BCommerce (Commerce on Core) for Salesforce, using the LWC (Lightning Web Component) within the LWR, this gist will call a commerce-api URL with the session credentials of the running user.
/* Returns a promise */
fetchCommerceUrl(url) {
let apiver = 'v64.0';
let commercebase = '/webruntime/api/services/data/' + apiver + '/commerce';
let fullurl = commercebase + url;
console.log('Begin fetchCommerceUrl on ', fullurl);
return fetch(fullurl, {
method: 'GET',
@nocrates
nocrates / log.js
Created July 10, 2025 16:38 — forked from megasmack/log.js
LWC Commerce get API Methods Available.
import checkoutApi from "commerce/checkoutApi";
import cartApi from "commerce/cartApi";
console.log("cartApi:", cartApi);
console.log("cartApi keys:", Object.keys(cartApi));
// Optional: Log function names individually
Object.keys(cartApi).forEach((key) => {
console.log(`cartApi[${key}] =`, cartApi[key]);
});
@nocrates
nocrates / heroku_connect_retryfails.sql
Created April 14, 2016 16:31
Heroku Connect fails to sync parent/child records that reference the same object, or Hierarchical relationship. For example, parent account and child account. This sql triggers auto-resubmit the failed records so that they succeed the second time. In addition a sync_status table is created to track the failures. This can be used for auditing and…
---
--- Table to store sync_status results.
--- mostly a counter for how sync failures
---
CREATE TABLE IF NOT EXISTS "public"."sync_status" (
id serial,
"createddate" timestamp with Time Zone NOT NULL DEFAULT now(),
"lastmodifieddate" timestamp with Time Zone NOT NULL DEFAULT now(),
"count_fail" integer DEFAULT 1,
"recordid" integer not null,
/*
* RecordTypeAccessor_Test
*
* Test method and example usage of https://gist.github.com/nocrates/07342092bcac673b62e8
*
* (c) Appirio 2013
*/
@isTest
public class RecordTypeAccessor_Test {
/*
RecordTypeAccessor
(c) Appirio, 2013
See https://gist.github.com/nocrates/5f8748b6ea6cdbba37a6 for test method and example usage
*/
public class RecordTypeAccessor {
@nocrates
nocrates / gource.sh
Last active February 11, 2016 07:38
# Thanks to https://gist.github.com/qiaoxueshi/5910150
# brew install gource
# git clone git://git.libav.org/libav.git
# cd libav
# ./configure --disable-yasm
# make && make install
gource \
-s .06 \
-1280x720 \
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<div class="row">
<div class="col-md-6 col-sm-6 hidden-xs">Apple</div>
<div class="col-md-6 col-sm-6 col-xs-12">Orange</div>
<div class="hidden-md hidden-sm col-xs-12 visible-xs-inline">Apple</div>
</div>