Skip to content

Instantly share code, notes, and snippets.

Avatar
🛍️
Focusing on Shopify Development

Balo UbaldoRosas

🛍️
Focusing on Shopify Development
View GitHub Profile
@UbaldoRosas
UbaldoRosas / Shopify
Created Sep 24, 2018
Shopify - Product information for email templates
View Shopify
{
"id":1503438176369,
"title":"Test Product Brazalete - Opción 3",
"price":"99.00",
"line_price":"99.00",
"quantity":1,
"sku":"",
"grams":0,
"properties":[
[
View ScrollMagic_Clean.js
SM = {
controller : new ScrollMagic.Controller(),
elems : {
animatedElement : $('#animated-element')
}
}
cleanSM : function() {
SM.controller = SM.controller.destroy(true);
@UbaldoRosas
UbaldoRosas / JS - Sprites animator.js
Last active Jul 24, 2019
Javascript | Sprites animator
View JS - Sprites animator.js
animated_sprite = function () {
this.vars = {
currentIndex : 0,
path : null,
class : null,
interval : null,
lenght : null,
time : null
}
this.init = function(sprite, lenght = null, time)
@UbaldoRosas
UbaldoRosas / jquery_validation_extension_method.js
Created Nov 6, 2019
Jquery Validation Plugin - Extension custom method
View jquery_validation_extension_method.js
jQuery.validator.addMethod("extension", function (value, element, param) {
param = typeof param === "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif";
return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i"));
}, "Please enter a value with a valid extension.")
@UbaldoRosas
UbaldoRosas / codeigniter_rename_file_while_upload.php
Last active Nov 6, 2019
Codeigniter - Rename file while upload
View codeigniter_rename_file_while_upload.php
<?php
/*
Author: Mukesh Jakhar
Description: Rename file while uploading in codeigniter (Controller)
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class Image extends CI_Controller {
function __construct() {
parent::__construct();
}
View random-number-animator.js
(function($){
$.fn.extend({
numAnim: function(options) {
if ( ! this.length)
return false;
this.defaults = {
endAt: 2560,
numClass: 'autogen-num',
duration: 5, // seconds
@UbaldoRosas
UbaldoRosas / JS get today date.js
Last active Feb 20, 2020
JS Script to get today date
View JS get today date.js
function today() {
var todaysDate = new Date(); // Gets today's date
var year = todaysDate.getFullYear(); // YYYY
var month = ("0" + (todaysDate.getMonth() + 1)).slice(-2); // MM
var day = ("0" + todaysDate.getDate()).slice(-2); // DD
var today = (year +"-"+ month +"-"+ day); // Results in "YYYY-MM-DD" for today's date
return today;
View shopify-order-notification-es.liquid
{% capture email_title %}Gracias por tu compra! {% endcapture %}
{% capture email_body %}
{% if requires_shipping %}
Hola {{ customer.first_name }}, vamos a preparar tu pedido de acuerdo a tus especificaciones. Deberás recibir tus anteojos en un lapso no mayor a 10 días hábiles. Por este medio, te notificaremos el servicio de paquetería que utilizaremos y el número de rastreo..
{% endif %}
{% endcapture %}
<!DOCTYPE html>
<html lang="en">
<head>
@UbaldoRosas
UbaldoRosas / klaviyo-newsletter.css
Last active Jun 23, 2020
Klaviyo newsletter & pop-up fix
View klaviyo-newsletter.css
/*
* Prefixed by https://autoprefixer.github.io
* PostCSS: v7.0.29,
* Autoprefixer: v9.7.6
* Browsers: last 6 version
*/
.klaviyo-newsletter {
max-width: 205px;
}
@UbaldoRosas
UbaldoRosas / shopify-pagination-links.liquid
Last active Oct 22, 2020
Shopify pagination links with pages range. Currently shows 3 pages more and 3 pages less
View shopify-pagination-links.liquid