Skip to content

Instantly share code, notes, and snippets.

View mig1098's full-sized avatar

miglio esaud mig1098

View GitHub Profile
!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()}();
@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/
@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 / 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}
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({
function cleanString($text) {
$utf8 = array(
'/[áàâãªä]/u' => 'a',
'/[ÁÀÂÃÄ]/u' => 'A',
'/[ÍÌÎÏ]/u' => 'I',
'/[íìîï]/u' => 'i',
'/[éèêë]/u' => 'e',
'/[ÉÈÊË]/u' => 'E',
'/[óòôõºö]/u' => 'o',
'/[ÓÒÔÕÖ]/u' => 'O',
$replace = [
'&lt;' => '', '&gt;' => '', '&#039;' => '', '&amp;' => '',
'&quot;' => '', 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'Ae',
'&Auml;' => 'A', 'Å' => 'A', 'Ā' => 'A', 'Ą' => 'A', 'Ă' => 'A', 'Æ' => 'Ae',
'Ç' => 'C', 'Ć' => 'C', 'Č' => 'C', 'Ĉ' => 'C', 'Ċ' => 'C', 'Ď' => 'D', 'Đ' => 'D',
'Ð' => 'D', 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ē' => 'E',
'Ę' => 'E', 'Ě' => 'E', 'Ĕ' => 'E', 'Ė' => 'E', 'Ĝ' => 'G', 'Ğ' => 'G',
'Ġ' => 'G', 'Ģ' => 'G', 'Ĥ' => 'H', 'Ħ' => 'H', 'Ì' => 'I', 'Í' => 'I',
'Î' => 'I', 'Ï' => 'I', 'Ī' => 'I', 'Ĩ' => 'I', 'Ĭ' => 'I', 'Į' => 'I',
'İ' => 'I', 'IJ' => 'IJ', 'Ĵ' => 'J', 'Ķ' => 'K', 'Ł' => 'K', 'Ľ' => 'K',
@mig1098
mig1098 / currencies.liquid
Created October 27, 2015 19:53 — forked from carolineschnapp/currencies.liquid
currencies.liquid
{% if settings.show_multiple_currencies %}
{{ "//cdn.shopify.com/s/javascripts/currencies.js" | script_tag }}
{{ "jquery.currencies.min.js" | asset_url | script_tag }}
<script>
Currency.format = '{{ settings.currency_format | default: 'money_with_currency_format' }}';
var shopCurrency = '{{ shop.currency }}';
<?php
namespace Library;
class Pagination{
/*
*/
/*Default values*/
var $total_pages = -1;//items
var $limit = null;
var $target = "";
{% for link in linklists.main-menu.links %}
{% comment %}
Create a dropdown menu by naming a linklist the same as a link in the parent nav
More info on dropdowns:
- http://docs.shopify.com/manual/your-website/navigation/create-drop-down-menu
{% endcomment %}
{% assign child_list_handle = link.title | handleize %}
{% if linklists[child_list_handle].links != blank %}
<li class="site-nav__item site-nav__expanded-item site-nav--has-dropdown{% unless template == 'index' %}{% if link.active %} site-nav--active{% endif %}{% endunless%}" aria-haspopup="true">