Skip to content

Instantly share code, notes, and snippets.

View Maybach91's full-sized avatar
👁️
Whats poppin’?

Patrick Ludewig Maybach91

👁️
Whats poppin’?
View GitHub Profile
@Maybach91
Maybach91 / shopify-change-rem-values-to-standard.rb
Last active May 17, 2022 13:40
[Shopify: Change all rem values to default / tailwind one] Dawn Theme is using html { font-size: 62.5% } to make rem working like 1.6rem to achieve 16px. But this is not working with tailwind or the standard way. #shopify #tailwind #rem #values
require 'bigdecimal'
def custom_round value
BigDecimal(value * 2, 2).to_f / 2
end
Dir.glob('**/*.{css,liquid}').each do |file|
fixed_file_content = File.read(file).gsub(/(?<!\w)([\d\.]+)rem/) do
value_in_pixels = $1.to_f * 10
value_in_standard_rems = value_in_pixels.to_f / 16
@Maybach91
Maybach91 / collection-load-more.js
Last active October 27, 2023 13:19
[Shopify Load More Products Button Javascript] its the vanilla javascript version #shopify #loadmore #products #collection #tailwind
const products_on_page = document.getElementById('product-grid');
let next_url = products_on_page.dataset.nextUrl;
const load_more_btn = document.getElementsByClassName('load-more_btn')[0];
const load_more_spinner = document.getElementsByClassName('load-more_spinner')[0];
async function getNextPage() {
try {
let res = await fetch(next_url);
return await res.text();
} catch (error) {
@Maybach91
Maybach91 / formular.html
Created August 19, 2020 15:45
[wordpress email template] #wordpress
<div class="row">
<div class="col-md-6">
<div class="form-item">
<label> Vorname
[text* vorname placeholder "z.B. Chris"] </label>
</div>
</div>
<div class="col-md-6">
<div class="form-item">
<label> Nachname
@Maybach91
Maybach91 / Pull-Merge-Request-Template.md
Last active August 19, 2020 15:41
[Pull Request / Merge Request Template for Gitworkflow] When creating a new Pull Request this template should be used as prefilled content for the PR description. Has to be placed in .github/ folder in the DEFAULT branch of the repo. #github #pullrequest #mergerequest #template

Description:

Describe what you have changed in this Pull Request and why.

Related User Story:

https://jira.atlassian.net/browse/XX-XXX

Tasks:

  • Add a list of tasks here that need to done to implement the change
  • All tasks must be checked before a (final) review is requested on the Pull Request
@Maybach91
Maybach91 / onEdit.gs
Last active August 17, 2020 12:21
[Google Sheet Script - increment cell value onEdit() of specific row] #gsheet #actionscript #onedit #googlesheet #onedit #increment
/*
** Increment a cell value by number, when edit a specific cell.
*/
/*
** Edit ONLY these ↓ variables
**/
// The name of the sheet, where the values has to be updated
var sheetName = 'Tabellenblatt1';
@Maybach91
Maybach91 / netlify-function.js
Last active March 9, 2021 15:34
[gatsby + shopify + recurring payments] "instead of taking the user to shopify's checkout, you need to create a recharge's checkout. This can be only done from a server (backend) so you will either have to set one up or use serverless functions (I am using functions from netlify)." – https://github.com/blancomaberino - https://spectrum.chat/gats…
/* eslint-disable */
const fetch = require('node-fetch')
const rechargeToken = process.env.RECHARGE_TOKEN
const subscriptionIntervalFrequency = process.env.SUBSCRIPTION_INTERVAL_FREQUENCY || 30
const subscriptionIntervalUnit = process.env.SUBSCRIPTION_INTERVAL_UNIT || 'day'
/**
* Builds request headers
* @return {Array}
*/
const buildHeaders = () => ({
@Maybach91
Maybach91 / related-blogposts-articles-json.liquid
Last active December 23, 2022 17:21
[Shopify iterate over more than 50 - all collection items] Shopify has a limit to only give 50 items back per collection. So we have to offset the loops till we got all items. #shopify #liquid
@Maybach91
Maybach91 / bash.sh
Created April 6, 2020 16:35
[run php locally]
php -S localhost:5000
@Maybach91
Maybach91 / README.md
Last active April 2, 2020 16:15
Shopify – Concat SCSS files to one single SCSS file with Gulp