Skip to content

Instantly share code, notes, and snippets.

View UbaldoRosas's full-sized avatar
🛍️
Focusing on Shopify Development

Balo UbaldoRosas

🛍️
Focusing on Shopify Development
View GitHub Profile
@UbaldoRosas
UbaldoRosas / codeigniter_rename_file_while_upload.php
Last active November 6, 2019 15:42
Codeigniter - Rename file while upload
<?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();
}
@UbaldoRosas
UbaldoRosas / jquery_validation_extension_method.js
Created November 6, 2019 15:42
Jquery Validation Plugin - Extension custom method
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 / JS - Sprites animator.js
Last active July 24, 2019 17:59
Javascript | Sprites animator
animated_sprite = function () {
this.vars = {
currentIndex : 0,
path : null,
class : null,
interval : null,
lenght : null,
time : null
}
this.init = function(sprite, lenght = null, time)
SM = {
controller : new ScrollMagic.Controller(),
elems : {
animatedElement : $('#animated-element')
}
}
cleanSM : function() {
SM.controller = SM.controller.destroy(true);
@UbaldoRosas
UbaldoRosas / Shopify
Created September 24, 2018 17:16
Shopify - Product information for email templates
{
"id":1503438176369,
"title":"Test Product Brazalete - Opción 3",
"price":"99.00",
"line_price":"99.00",
"quantity":1,
"sku":"",
"grams":0,
"properties":[
[