Skip to content

Instantly share code, notes, and snippets.

View octipus's full-sized avatar
🎯
Focusing

oContis Studio octipus

🎯
Focusing
View GitHub Profile
@panoply
panoply / component.ts
Last active September 6, 2023 09:16
Shopify Size Charts
import { LiteralUnion } from 'type-fest';
import { Controller } from '@hotwired/stimulus';
import * as customer from 'application/customer';
export class Sizing extends Controller {
/**
* Stimulus Values
*/
static values = {
@loughlincodes
loughlincodes / gist:0f98ace464acd1f47cd887b5c7c31158
Created October 8, 2019 12:11
Shopify Loox Reviews - get total reviews
<div class="reviews">
{% assign looxstats = shop.metafields.loox["global_stats"] | split: "," %}
{% assign looxstar = looxstats[0] | round %}
{% assign looxcount = looxstats[1] | times:100 | money_without_currency | remove: '.00' %}
<a href="pages/happy-customers">Reviews (<span class="looxstars">{% for i in (1..looxstar) %}&#9733;{% endfor %}</span> {{ looxcount }})</a>
</div> <!-- end review -->
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 16, 2025 13:07
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@bneff84
bneff84 / pre-request-script.js
Last active May 15, 2024 09:38
Postman WSSE Header Generation Pre-request Script (Tailored for Emarsys)
/*
* This script should be used as the pre-request script for any requests made to Emarsys. In theory, it should work for any API that implements WSSE authentication as well.
* To Use:
* 1: Set an environment variable for wsse-user and wsse-secret containing your WSSE user and secret respectively
* 2: On your Headers tab, add an X-WSSE header with a value of {{wsse-header}}
*
* That's it! When you make a request, the pre-request script will generate your Nonce, Timestamp, and Digest using your secret. The 1-time-use header will be stored in the environment as wsse-header and used for your request.
*/
//
// wsse.js - Generate WSSE authentication header in JavaScript
@dlindenkreuz
dlindenkreuz / gist:a439ec4b939f0561d6d9
Last active April 9, 2024 10:43 — forked from tyteen4a03/gist:3420a9e121d13b091343
Shopify handleize function in JavaScript
// one-liner version
// retains latin-1 supplement chars as well as latin extended-a and latin extended-b
Shopify.handleize = function (str) {
return str.toLowerCase().replace(/[^\w\u00C0-\u024f]+/g, "-").replace(/^-+|-+$/g, "");
};
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@cobyism
cobyism / gh-pages-deploy.md
Last active May 20, 2025 01:15
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).