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 | |
/* | |
* Force File Download. | |
* Usage: http://example.com/download.php?file=./uploads/image.jpg | |
* | |
* There are a couple of *ninja* exit() as security guarantee, adapt as necessary. | |
* | |
*/ | |
// Grab the requested file's name. |
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
$(document).on('input', 'input, textarea', function () { | |
var $el = $(this), | |
val = $el.val(); | |
if (val.length) { | |
$el.css({direction: isRTL(val) ? 'rtl' : 'ltr'}); | |
} else { | |
$el.css({direction: ""}); | |
} | |
}); |
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
/** | |
* Finds the smallest positive integer which does not exist in an array. | |
* | |
* @param array $a | |
* The array to check. | |
* | |
* @return int | |
* The smallest positive integer not found in $a. | |
*/ | |
function solution2(array $a) { |
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
http://jsfiddle.net/ianclark001/rkocah23/ |
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 get_custom_post_types_and_page_templates() { | |
global $wp_post_types; | |
// Public custom post types. | |
$args = [ | |
'public' => true, | |
'_builtin' => false, | |
]; | |
// Get the lists and add a suffix which denotes the type, Page or Post. |
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 queryString = {}; | |
location.search.substr(1).split("&").forEach(function (pair) { | |
if (pair.length) { | |
var parts = pair.split("="); | |
queryString[parts[0]] = decodeURIComponent(parts[1].replace(/\+/g, " ")); | |
} | |
}); | |
console.log(queryString); |
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 (history.pushState) { //IE10+ | |
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + decodeURIComponent(window.location.search); | |
window.history.pushState({path:newurl},'',newurl); | |
} |
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
((general).*?(override)) |
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
/** | |
* Wrap each letter of text in the given element in a span tag. | |
*/ | |
$.fn.lettering = function () { | |
this.each(function (index) { | |
var elem = $(this), | |
characters = elem.text().split(""); | |
elem.empty(); |
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
<div class="c-forms w50"> | |
<div class="row no-gutters"> | |
<div class="col-md-6 col-xl-4 pad-by-location"> | |
<div> | |
<label> Full Name* [text* full_name placeholder "Full Name"] </label> | |
</div> | |
</div> | |
<div class="col-md-6 col-xl-4 pad-by-location"> | |
<div> | |
<label> Company Name* [text* company_name placeholder "Company Name"] </label> |
NewerOlder