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
//autocompress:no | |
/*! | |
* Disables invisible (non focusable elements) form fields inside forms while validating. | |
* | |
* @author Ruben Vincenten <[email protected]> | |
* @see https://github.com/1000hz/bootstrap-validator | |
*/ | |
jQuery(function ($) { | |
var | |
dataKey = 'validate.bs.skip', |
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
jQuery(function ($) { | |
if (!inputsupport('datetime-local')) { | |
$('[type=datetime-local]').each(function () { | |
var $input = $(this), placeholder = $input.attr('placeholder'); | |
$input.attr({ | |
type: 'text', | |
placeholder: this.hasAttribute('placeholder') ? placeholder + ' (JJJJ-MM-DD UU:MM)' : 'JJJJ-MM-DD UU:MM', | |
pattern: '20\\d{2}(-|\/)((0[1-9])|(1[0-2]))(-|\/)((0[1-9])|([1-2][0-9])|(3[0-1]))(T|\\s)(([0-1][0-9])|(2[0-3])):([0-5][0-9])(:([0-5][0-9]))?' | |
}); | |
}); |
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 textualRatio = (function () { | |
var | |
isInteger, | |
greatestCommonDivisor; | |
/** | |
* | |
* @param value | |
* @returns {boolean} | |
*/ |
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
{ | |
"require": { | |
"doctrine/dbal": "~2.5" | |
} | |
} |
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 | |
use Negotiation\LanguageNegotiator; | |
// example array | |
$languages = array( | |
1=>array('name'=>'english', 'lang_id'=>'en'), | |
2=>array('name'=>'dutch', 'lang_id'=>'nl') | |
); |
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
# if you use git gui/cmd shell... | |
# *.mwb diff=mwb |
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 | |
function nl2p($string, $class = '') | |
{ | |
$class_attr = ($class != '') ? ' class="' . $class . '"' : ''; | |
return '<p' . $class_attr . '>' . preg_replace('#(<br\s*?/?>\s*?){2,}#', '</p>' . "\n" . '<p' . $class_attr . '>', nl2br($string, true)) . '</p>'; | |
} |
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 | |
/** | |
* @param array $array | |
* @param string|integer $position numeric key | |
* @param array $insert_array | |
* @param string $at | |
*/ | |
function array_insert(array &$array, $position, array $insert_array, $at = 'after') | |
{ |
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 | |
function strftime_win32($format, $ts = null) { | |
if (!$ts) $ts = time(); | |
$mapping = array( | |
'%C' => sprintf("%02d", date("Y", $ts) / 100), | |
'%D' => '%m/%d/%y', | |
'%e' => sprintf("%' 2d", date("j", $ts)), | |
'%h' => '%b', |
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
jQuery(function ($) { | |
var sku_fields = '[name^="variable_sku"]', | |
display_class = 'variation_sku_display', | |
warning_display = true; | |
$('body').on('input', sku_fields, function () { | |
var $input = $(this), sku = this.value, | |
$variation = $input.closest('.woocommerce_variation'), | |
$display = $('.' + display_class, $variation); | |
if (!$display.length) { |