Skip to content

Instantly share code, notes, and snippets.

@philcon93
philcon93 / 1.md
Last active February 11, 2020 07:16
Sales Order filter options

Filters

Suggested Filters

  1. order:
  • order:id
  • order:status
@philcon93
philcon93 / 1.js
Last active November 27, 2019 05:03
Beacon analytics
const sendData = function(endpoint = '/endpoint', type = true) {
const formData = JSON.stringify({
siteId: 'NETO.systemConfigs.siteId',
url: {
hostname: window.location.hostname,
pathname: window.location.pathname,
search: window.location.search
},
entries: performance.getEntries('navigation')[0],
resources: performance.getEntriesByType('resource').length
@philcon93
philcon93 / Page_footer.html
Last active November 26, 2019 00:56
afterpay_webstore
@philcon93
philcon93 / 1.js
Created September 12, 2019 04:57
Hide payment options if bill country in EU
var nEU = {
// List of EU countries / their country code;
isInEu: function(){
var countries = ['ES', 'NO'];
var billCountry = $('#bill_country').val();
for (var i = 0; i < countries.length; i++) {
if(countries[i] == billCountry){
return true;
@philcon93
philcon93 / 1.js
Last active August 6, 2019 23:24
Toolbar swatches
var swatches = {
swatchesArray: ['blue', 'pink', 'green', 'yellow', 'purple', 'orange', 'dark'],
pageClass: '.netoPage',
styles: function(){
return `
/* Blue */
.netoPage.blue #netoToolbar {
background-color: #083E52;
border-bottom: solid 1px #083E52;
@philcon93
philcon93 / 1.sh
Created March 18, 2019 00:18
Percy bash script
#!/bin/bash
# Build with the build script
echo "Building Style Guide..."
npm run build
# Set the environment to be percy account
export PERCY_TOKEN=XXXXX
export PERCY_PROJECT=Neto/Style-Guide
@philcon93
philcon93 / 1.js
Last active February 25, 2019 08:49
Revealing Module Pattern with import/export
export addressBook = (function(){
var phil = 'phil';
return{
billingAddress: 'QLD'
};
})()
export addToCart = (function(){
var phil = 'phil';
return{
cartId: '123'
@philcon93
philcon93 / 1.md
Last active December 13, 2018 22:59
picture html

WebP provides consistently smaller file sizes than its alternatives. In a comparative study of these image formats, it was found that WebP lossy images were on average 30% smaller than JPGs and WebP lossless images were on average 25% smaller than PNG.

<picture>
    <source type="image/webp" srcset="image.webp">
    <source type="image/jpeg" srcset="image.jpg">
    <img src="image.jpg" alt="My Image">
</picture>
@philcon93
philcon93 / 1.html
Created October 25, 2018 01:49
Make a canvas, then convert it to an image
<canvas id="viewport"></canvas>
<script>
var canvas = document.getElementById('viewport');
var context = canvas.getContext('2d');
make_base();
var img = canvas.toDataURL("image/png");
@philcon93
philcon93 / 1.json
Created October 8, 2018 05:28
managed checkout locale
{
"checkout" : {
"general": {
"header_title": "Checkout",
"paypal_redirect": "You are now being redirected to the PayPal website to checkout.",
"processing_incomplete_01": "Important! Your order is not yet complete.",
"processing_incomplete_02": "Please confirm your billing and shipping details below and click the &quot;Confirm &amp; Process Order&quot; button at the bottom of this page to complete your purchase.",
},
"customer": {
"login_label": "Returning customer?",