Skip to content

Instantly share code, notes, and snippets.

View maxkostinevich's full-sized avatar
🚧
Work in progress

Max Kostinevich maxkostinevich

🚧
Work in progress
View GitHub Profile
@maxkostinevich
maxkostinevich / herd-reverb-ssl.md
Created April 15, 2024 15:08 — forked from conradfuhrman/herd-reverb-ssl.md
Laravel Herd, SSL, and Reverb with Herd

The biggest issue with Herd Pro is that you cannot use Reverb out of the box with a site that has SSL enabled. Here is the workaround for it all to play nicely together.

First you will need to create two sites. The two I have here are as follows:

  • reverb-ssl - This is a new Laravel 11 project using Breeze for the ease of Inertia. This also follows the setup for Reverb line by line.
  • wss-reverb-ssl - This is an empty directory, we are going to use this only for editing a Nginx config and setting up a proxy to the reverb service.

Screenshot 2024-04-03 at 2 33 08 PM

Of note is that I'm using Herd Pro as well, so all additional services are being used directly though Herd Pro itself.

@maxkostinevich
maxkostinevich / worker.js
Created June 29, 2020 11:25
Serverless Geolocation Service
/*
* Serverless Geolocation Service, hosted on Cloudflare Workers.
*
* Learn more at https://maxkostinevich.com/blog/serverless-geolocation
*
* (c) Max Kostinevich / https://maxkostinevich.com
*/
// https://gist.github.com/maephisto/9228207
@maxkostinevich
maxkostinevich / index.html
Created January 4, 2020 14:27
Serverless Social Proof widget for Shopify
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Static Template</title>
</head>
<body>
<h1>
@maxkostinevich
maxkostinevich / index.html
Last active April 21, 2024 06:42
Cloudflare Worker - Handle Contact Form
<!--
/*
* Serverless contact form handler for Cloudflare Workers.
* Emails are sent via Mailgun.
*
* Learn more at https://maxkostinevich.com/blog/serverless-contact-form
* Live demo: https://codesandbox.io/s/serverless-contact-form-example-x0neb
*
* (c) Max Kostinevich / https://maxkostinevich.com
*/
@maxkostinevich
maxkostinevich / main.yml
Created January 1, 2020 20:37
Github Actions - Deploy Jigsaw to Github Pages
# Learn more at https://maxkostinevich.com/blog/deploy-jigsaw-using-github-actions
name: Deploy
on:
push:
branches:
- master
jobs:
@maxkostinevich
maxkostinevich / dev.yml
Last active March 12, 2024 17:18
Github Actions - Deploy Serverless Framework (AWS)
#
# Github Actions for Serverless Framework
#
# Create AWS_KEY and AWS_SECRET secrets in Github repository settings
# If you're using env.yml file, store its content as ENV Github secret
#
# Master branch will be deployed as DEV and every new tag starting with "v**" (e.g. v1.0, v1.2, v2.0, etc) will be deployed as PROD
#
# Learn more: https://maxkostinevich.com/blog/how-to-deploy-serverless-applications-using-github-actions/
#
@maxkostinevich
maxkostinevich / script.rb
Created June 7, 2018 07:30
Shopify Script #5 - Buy anything from collection A and get anything from collection B with X% discount
# Buy anything from collection A and get anything from collection B with X% discount,
# if discount code XYZ is applied
# Custom Message
CHECKOUT_MESSAGE = "Get a 50% off"
# Discount code which should me appled
DISCOUNT_CODE = "GET50OFF"
COLLECTION_A = ["BACKPACKS"]
@maxkostinevich
maxkostinevich / script.rb
Created June 7, 2018 07:24
Shopify Script #4 - Discounts by Product Type and Customer Tag
# Discounts by Product Type and Customer Tag
# Custom Message
CHECKOUT_MESSAGE = "Special discount"
# Customer tags
CUSTOMER_TAGS = ["Wholesale","B2B"]
# Discount rules
# PRODUCT CATEGORY => DISCOUNT VALUE ($)
@maxkostinevich
maxkostinevich / script.rb
Created June 7, 2018 07:21
Shopify Script #3 - Bulk Discount (Product Category and Quantity)
# Bulk Discount based on Product Category and Quantity
# Applied product types
# Example with 2 categories: ["Backpack", "T-Shirt"]
PRODUCT_TYPES = ["Backpack"]
# Custom message
CHECKOUT_MESSAGE = "Bulk Discount 25% Off"
# Discount value, should be a number without "%"
@maxkostinevich
maxkostinevich / script.rb
Created June 7, 2018 07:19
Shopify Script #2 - Buy two of X item for $Y
# Buy two of X item for $Y
# Applied product types
PRODUCT_TYPES = ["Backpack"]
# Custom message
CHECKOUT_MESSAGE = "Get two for $50"
# Price for pair in dollars
PAIR_PRICE = 50