Skip to content

Instantly share code, notes, and snippets.

View mig1098's full-sized avatar

miglio esaud mig1098

View GitHub Profile
function cleanString($text) {
$utf8 = array(
'/[áàâãªä]/u' => 'a',
'/[ÁÀÂÃÄ]/u' => 'A',
'/[ÍÌÎÏ]/u' => 'I',
'/[íìîï]/u' => 'i',
'/[éèêë]/u' => 'e',
'/[ÉÈÊË]/u' => 'E',
'/[óòôõºö]/u' => 'o',
'/[ÓÒÔÕÖ]/u' => 'O',
var MGUtil={
data:[],
ini:0,
total:0,
addItem:function(qty,id,properties,callback) {
var params = {quantity:qty,id:id};
if(properties != false){
params.properties = properties;
}
$.ajax({
@mig1098
mig1098 / Shopify.php
Last active October 21, 2015 21:28
shopify private an public extension php client
<?php
namespace Model;
/**
* SHOPIFY PUBLIC AND PRIVATE APP
* ----------------------------------------------
* @Author : Miglio - [email protected]
* @updated : Miglio 2015
* ----------------------------------------------
* DEVELOPER APP KEYS:
* {@api_key},{@secret}
@mig1098
mig1098 / Cartesian.php
Last active August 26, 2015 14:14 — forked from jwage/Cartesian.php
PHP Cartesian Function
<?php
$attributeValues = array(
'color' => array('Red', 'White', 'Blue'),
'size' => array(1, 2, 3, 4),
'fabric' => array('Cloth', 'Silk')
);
class Cartesian
{
@mig1098
mig1098 / .htaccess
Last active August 29, 2015 14:25 — forked from ScottPhillips/.htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
!function(){var a='<div id="mgcontent">direct bathrooms<br /><a href="www.google.com">linked</a></div>',b=function(){var c={content:$("#mgcontent"),body:$("body"),jquery:!0};return{loadfiles:function(){var a=document.createElement("link");if(a.type="text/css",a.rel="stylesheet",a.id="test1",a.href="//apolomultimedia.us/mg/test1/test1.css",document.getElementsByTagName("head")[0].appendChild(a),"undefined"!=typeof window.jQuery&&"undefined"!=typeof jQuery||c.jquery===!1)console.log("jquery exist");else{var b=document.createElement("script");b.type="text/javascript",b.src="//apolomultimedia.us/mg/test1/jquery.tstmin.js",document.getElementsByTagName("head")[0].appendChild(b),console.log("jquery added")}},changeImg:function(){$("img").attr("src","//apolomultimedia.us/royalty/resources/images.jpg")},addcontent:function(){c.body.prepend(a),$("#mgcontent a").on("click",function(a){a.preventDefault()}),console.log(c)},init:function(){b.loadfiles(),b.changeImg()}}}();b.init()}();