Skip to content

Instantly share code, notes, and snippets.

View Kadreev's full-sized avatar
🚀
Reaching goals

Kadreev

🚀
Reaching goals
View GitHub Profile
@Kadreev
Kadreev / script
Created March 5, 2022 16:56
Shopify Box in post purchase page
<script> Shopify.Checkout.OrderStatus.addContentBox('<h2>Pick-up in store</h2>', '<p>We are open everyday from 9am to 5pm.</p>') </script>
@Kadreev
Kadreev / regex
Last active March 5, 2022 16:56
Find and replace all href=""
(?<=href=("|'))[^"']+(?=("|'))
@Kadreev
Kadreev / mem
Created March 5, 2022 16:55
Caching Memorization
const cache = {}; const myFunc = (input) => { if (cache[input]) { return cache[input]; }; console.log(`calculating...`); const value = input * 2; cache[input] = value; return value; }; myFunc(1); myFunc(2); myFunc(1);
@Kadreev
Kadreev / svg placeholder
Created March 5, 2022 16:55
Responsive SVG Placeholder
data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3C/svg%3E
@Kadreev
Kadreev / Shopify If Admin
Created March 5, 2022 16:54
Shopify if Admin
{% if content_for_header contains 'adminBarInjector' %}
{% endif %}