Skip to content

Instantly share code, notes, and snippets.

@FLWallace105
FLWallace105 / sinatra-start.service
Created December 10, 2024 23:41
Create Sinatra SystemD Service with RBENV
[Unit]
Description=Start Sinatra Charge Listener Server
AssertPathExists=/home/your_path/charge_listener
[Service]
Type=simple
User=your_user
WorkingDirectory=/home/your_path/charge_listener
ExecStart=/home/your_path/.rbenv/bin/rbenv exec bundle exec puma --config config/puma.rb
[Install]
@FLWallace105
FLWallace105 / install_shell.sh
Created December 10, 2024 23:36
Install Ruby 3.3.6 on Ubuntu 24.04 ARM64
# Ubuntu 24.04 ARM version is missing default libraries, seems like only RBENV can build ruby 3.3.6 on ARM.
# Strategy: install libraries needed, build with RBENV.
# ARM64 is half the cost for Intel on AWS.
sudo apt update
sudo apt install build-essential git
sudo apt-get install libffi-dev libffi8
sudo apt-get install libyaml-0-2
sudo apt-get install libtool
sudo apt-get install libyaml-dev
https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
@FLWallace105
FLWallace105 / Readme.md
Last active November 13, 2024 04:38
Shopify function 2 for 25 How To

Create a Shopify Function to do 2 for $25 Items

Requirements: You want a Shopify Function to do a 2 for $25 discount like what is availble in Shopify Scripts (soon to be removed).

Your products can have different prices, some might be $29.99, some might be $25.99, others might be $19.99. You don't want to change the original prices. You want every combination of eligible produccts to be discounted to $12.50, i.e. "2 for $25" and if you have an odd total: say a cart has 2 of one eligble product and 3 of other eligible products, the most expensive one is not fully discounted (don't discount one of them). You also want a call to action to the customer to add another item in the not fully discounted line item to get the full discount.

Your eligible products are identified with a tag "2FOR25" .

Run.graphql

Your run.graphql should look like this: