Skip to content

Instantly share code, notes, and snippets.

View Kadreev's full-sized avatar
🏠
Working from home

Kadreev

🏠
Working from home
View GitHub Profile
@Kadreev
Kadreev / store theme conn
Created November 16, 2023 23:34
shopify theme pull --store {store-name}
‎‎​
@Kadreev
Kadreev / shadows.txt
Created November 5, 2023 03:21
Nice Shadows
{% comment %} <div class="w-11/12 h-2 mx-auto bg-gray-300 rounded-b opacity-75 rounded-xs"></div>
<div class="w-10/12 h-2 mx-auto bg-gray-300 rounded-b opacity-50 rounded-xs"></div>
<div class="w-9/12 h-2 mx-auto bg-gray-300 rounded-b opacity-25 rounded-xs"></div> {% endcomment %}
@Kadreev
Kadreev / functions in object
Created July 1, 2022 02:40
functions in object
let voleur = {
action : () =>console.log ('Coup de dague fatal') ,
crie : ('pour la horde!!!!') ,
coupfatal :()=> console.log ('coup dans le dos')
}
voleur.action() ;
voleur.coupfatal() ;
console.log(voleur.crie) ;
@Kadreev
Kadreev / AlpineJS Select Tag
Created June 20, 2022 21:00
AlpineJS Select Tag
// vim: syntax=javascript
<div x-data="{foo :'not selected'}">
<select @change="foo = $event.target.value">
<option x-bind:value="1">option 1</option>
<option x-bind:value="2">option 2</option>
<option x-bind:value="3">option 3</option>
</select>
<span x-text="'option '+ foo"></span>
</div>
@Kadreev
Kadreev / permissions.file
Created June 6, 2022 10:54
update permissions
sudo chown -R boss /home/boss/DEV/vue-carte
@Kadreev
Kadreev / speed.js
Created June 6, 2022 08:04
Time the speed of functions
let i = 0;
console.time("While loop");
while (i < 100000) {
i++;
}
console.timeEnd("While loop");
console.time("For loop");
for (i = 0; i < 100000; i++) {
// For Loop
}
@Kadreev
Kadreev / button
Last active May 18, 2022 21:24
button #shopify
{% if settings.button_url %}
<a href="{{ settings.button_url }}" class="btn-red text-white font-bold rounded-full text-2xl mt-4 p-7 uppercase leading-3 w-full col-span-3">{{ settings.button_label }}</a>
{% endif %}
{
"type": "text",
"id": "button_label",
"label": "Button Label",
"default": "Shop Lifeboost"
@Kadreev
Kadreev / shopify.js
Created March 25, 2022 22:42
GLOBAL BINDING
/*
* Shopify Common JS
*
*/
if ((typeof window.Shopify) == 'undefined') {
window.Shopify = {};
}
Shopify.bind = function(fn, scope) {
return function() {
@Kadreev
Kadreev / progress
Created March 14, 2022 10:42
progress percentage increase
const updateCount = (setProgress, progressPercent) => {
const target = parseInt(setProgress.getAttribute("data-done"));
const count = parseInt(progressPercent.innerText);
const increment = 1;
if (count < target) {
progressPercent.innerText = count + increment;
setTimeout(updateCount, 50);
} else if (count > target) {
progressPercent.innerText = count - increment;
@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>