Skip to content

Instantly share code, notes, and snippets.

View javimata's full-sized avatar
💭
#CodeAndo

Javi Mata javimata

💭
#CodeAndo
View GitHub Profile
async function enviarScript(scriptText){
let main = document.querySelector("#main"),
textarea = main.querySelector(`div[contenteditable="true"]`)
const largo = 30
if(!textarea) throw new Error("No hay una conversación iniciada")
let n = 0;
let sendButton = main.querySelector(`[data-testid="send"]`) || main.querySelector(`[data-icon="send"]`);
@javimata
javimata / es.json
Last active March 22, 2024 14:18
Spanish json for Kalles 4.3.1
{
"sections": {
"announcement": {
"label": "Anuncio",
"close": "Cerrar"
},
"lookbook": {
"title": {
"product": "Producto",
"text": "Texto"
@javimata
javimata / settings.json
Created March 24, 2022 15:19
Settings vscode compile less to liquid
{
"less.compile": {
"compress": false,
"out": "./$1.css.liquid",
"autoprefixer": "> 5%, last 2 Chrome versions, not ie 6-9"
}
}
<?php
/*
* Llamaría al SDK de Shopify si se requiere
*/
// require "vendor/autoload.php";
// Esta llave la genera Shopify si el webhook se genera desde el administrador
define('SHOPIFY_APP_SECRET', 'a9f210ba885cf3cef74fe4b562a1c037f2e9f5XXXXXXXX');
function verify_webhook($data, $hmac_header)
/*
* Check if elements are visible in the current viewport
* If is visible add a class in-view else remove
*/
function isElementInViewport(el) {
var rect = el.getBoundingClientRect();
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
@javimata
javimata / check-visitor-country.js
Created August 25, 2021 17:32
Check country for a visitor
/*
* Info of ip get with https://ipinfo.io/ service
* Free service have 50k request/month
* If have a user need use the url https://ipinfo.io/json?<YourToken>
*/
/*
* Function to create a cookie, need
* cname = Name of cookie
@javimata
javimata / product-template.liquid
Last active August 1, 2022 17:06
Agrega Guía de tallas & Texto en Productos de Shopify
{% if section.settings.richtext_product %}
<div class="product__policies">
{{ section.settings.richtext_product }}
</div>
{% endif %}
{% if section.settings.tags_tallas != blank %}
{% for tag in product.tags %}
{% if tag contains section.settings.tags_tallas %}
{% if section.settings.image_tallas %}
@javimata
javimata / page-brands.liquid
Created February 8, 2021 23:13
Pages Brands - SHOPIFY
<div class="brands-page">
{% if section.settings.display_brands %}
<div class="brands-container container mb__40">
<div class="brands-row row">
{% for block in section.blocks %}
{% if block.settings.brand_link != blank %}
{%- comment -%}
------- Swatch -----------
{%- endcomment -%}
{%- liquid
assign pos360 = ''
assign optVr1 = ''
assign imgsPos = ''
assign imgsPos0 = 0
assign imgsPos1 = 0
{% if product.type == "Celular" %}
<div class="product-form__controls-group">
<div class="product-form__item">
<label for="texto">Graba tu nombre</label>
<input type="text" id="texto" name="properties[Texto]">
</div>
</div>
{% else %}
<div class="product-form__controls-group">
<div class="product-form__item">