View gist:4757512
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function subval_sort($a,$subkey) { | |
foreach($a as $k=>$v) { | |
$b[$k] = strtolower($v[$subkey]); | |
} | |
asort($b); | |
foreach($b as $key=>$val) { | |
$c[] = $a[$key]; | |
} | |
return array_reverse($c); | |
} |
View gist:5172346
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formatMoney($number, $fractional=false) { | |
if ($fractional) { | |
$number = sprintf('%.2f', $number); | |
} | |
while (true) { | |
$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number); | |
if ($replaced != $number) { | |
$number = $replaced; | |
} else { | |
break; |
View Bootstrap responsive mixin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin responsive($size) | |
@if $size == 'large' | |
@media (min-width: 1200px) | |
@content | |
@if $size == 'normal' | |
@media (min-width: 992px) and (max-width: 1199px) | |
@content | |
@if $size == 'tablet' | |
@media (min-width: 768px) and (max-width: 991px) | |
@content |
View gist:6040606
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var timer = setInterval(function(){ | |
for(var i = 0, liNbr = liEl.length; i < liNbr; i++){ | |
liEl.eq(i).css({left: liEl.eq(i).position().left + 1 }); | |
if(liEl.eq(i).position().left > liEl.eq(i).parent().width()){ | |
if(!liEl.eq(i).is(':animated')){ | |
liEl.eq(i).fadeOut(200, function(){ | |
$(this).css({left: '0px'}).prependTo($(this).parent()).fadeIn(200); | |
}); |
View jQueryPluginStart.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
'use strict'; | |
$.fn.pluginName = function(options, callback) { | |
//this selector | |
var thisEl = $(this); | |
// options | |
var settings = { | |
}; |
View taxonomy loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'orderby' => 'term_id', | |
'order' => 'ASC', | |
'hide_empty' => 0, | |
); | |
$product_categories = get_terms( 'product_cat', $args ); | |
$menuCat = array(); |
View azure-htaccess
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="Imported Rule 1" stopProcessing="true"> | |
<match url="^(*)$" ignoreCase="false" /> | |
<action type="Rewrite" url="myUrl.html" appendQueryString="true" /> | |
</rule> |
View web.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<staticContent> | |
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" /> | |
</staticContent> | |
</system.webServer> | |
</configuration> |
View web.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"> | |
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/> | |
<dynamicTypes> | |
<add mimeType="text/*" enabled="true"/> | |
<add mimeType="message/*" enabled="true"/> | |
<add mimeType="application/javascript" enabled="true"/> | |
<add mimeType="*/*" enabled="false"/> |
OlderNewer