This file contains hidden or 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 app.url = (location.href); //Cached for heavy general use | |
app.isOnPage = function(pageName) { | |
return app.url.split("?")[0].split("/").pop() == pageName; | |
} | |
//Usage | |
if (app.isOnPage("services")) { | |
alert("on services page"); | |
} |
This file contains hidden or 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
// random number, inputting botht the min and max number | |
function randomNum(from, to){ | |
return Math.floor(Math.random() * (to - from + 1) + from); | |
} | |
// Usage: randomNum(1, 100) | |
// random number, inputting only the max number | |
function randomNum(max) { | |
return Math.floor(Math.random() * max) + 1; |
This file contains hidden or 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 sel = $("selector"); | |
var coords = sel[0].getBoundingClientRect(); | |
// Usage | |
console.log(coords.top); | |
console.log(coords.bottom); | |
console.log(coords.left); | |
console.log(coords.right); |
This file contains hidden or 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
<!-- Bootstrap 3.2 Responsive Utilities > Test Cases - http://getbootstrap.com/css/#responsive-utilities-tests --> | |
<!-- This can be added to a project as needed --> | |
<!-- Add the helper class "hidden" to the main div if you want to temporarily hide it --> | |
<div class="row responsive-utilities-test visible-on"> | |
<div style="position:fixed; bottom:10px; left:10px; z-index:9999; padding:10px; background:rgba(255, 0, 255, 0.70); font-weight:bold; letter-spacing:1px;"> | |
<span class="visible-xs-block">Extra small (xs) | Phones (<768px)</span> | |
<span class="visible-sm-block">Small (sm) | Tablets (≥768px)</span> | |
<span class="visible-md-block">Medium (md) | Desktops (≥992px)</span> | |
<span class="visible-lg-block">Large (lg) | Desktops (≥1200px)</span> |
This file contains hidden or 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
// usage | |
// url: http://jsfiddle.net/?test=pirates%20&%20ninjas | |
// url: http://jsfiddle.net/?test=pirates & ninjas | |
var vars = [], hash; | |
var q = document.referrer.split('?')[1]; | |
if(q != undefined){ | |
q = q.replace("%20&%20", "%20%26%20") //Fix for passing ampersands through the URL | |
q = q.split('&'); | |
for(var i = 0; i < q.length; i++){ |
This file contains hidden or 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
{exp:channel:categories style="linear"} | |
<h2>{category_name}:</h2> | |
{exp:channel:entries channel="agent_forms" category="{category_id}" dynamic="no"} | |
{title}<br> | |
{body} | |
{/exp:channel:entries} | |
{/exp:channel:categories} |
This file contains hidden or 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
/* Formatted for GitHub */ | |
a {outline:1px dotted #D68A85!important;} | |
h1, h2, h3, h4, h5, h6 {outline:1px dotted #E7912D!important;} | |
li {outline:1px dotted #CECC33!important;} | |
span {outline:1px dotted #F0F!important;} | |
div {outline:1px dotted #3AB6F1!important;} | |
ul, ol {outline:1px dotted #8684D8!important;} | |
li {outline:1px dotted #DD67AE!important;} | |
table td {outline:1px dotted lightblue!important;} | |
i {outline:1px dotted gray!important;} |
This file contains hidden or 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
// Slightly modified version of Angular's method of checking for Internet Explorer (IE), including checking for IE11 | |
function detectIE() { | |
// check 6-10 | |
msie = parseInt((/msie (\d+)/.exec((navigator.userAgent).toLowerCase()) || [])[1]); | |
if (isNaN(msie)) { | |
// not 6-10, check 11 | |
msie = parseInt((/trident\/.*; rv:(\d+)/.exec((navigator.userAgent).toLowerCase()) || [])[1]); | |
} | |
This file contains hidden or 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
<!-- | |
Stash: http://devot-ee.com/add-ons/stash | |
Strip Line Breaks: http://devot-ee.com/add-ons/strip-line-breaks | |
Low Replace: http://devot-ee.com/add-ons/low-replace | |
--> | |
{exp:stash:set parse_tags="yes" parse_conditionals="yes" parse_depth="5" type="snippet"} | |
{exp:strip_line_breaks} | |
{stash:body_classes} | |
{exp:low_replace find="\t" replace="" regex="yes"} |
OlderNewer