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
$.getJSON('//country-finder.herokuapp.com/?callback=?', function (data) { | |
return data.geo.country.toLowerCase() | |
}); |
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 get = function(url, callback, error, format){ | |
if(!format) format = "json"; | |
var xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); | |
xmlhttp.onreadystatechange = function() { | |
if(xmlhttp.readyState == 4){ | |
if(xmlhttp.status == 200){ | |
if(typeof callback === "function") callback(format == "json" ? JSON.parse(xmlhttp.responseText) : xmlhttp.responseText); | |
} else { | |
if(typeof error === "function") error(format == "json" ? JSON.parse(xmlhttp.responseText) : xmlhttp.responseText); |
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
// Change 15 to the password length | |
(function(e){var t="abcdefghijklmnopqrstuvwxz1234567890!@#$%?".split(""),n="";do{var r=t[Math.floor(Math.random()*t.length)];n+=Math.random()>.5?r.toUpperCase():r.toLowerCase()}while(n.length<e);return n})(15) |
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
'AF','AX','AL','DZ','AS','AD','AO','AI','AQ','AG','AR','AM','AW','AU','AT','AZ','BS','BH','BD','BB','BY','BE','BZ','BJ','BM','BT','BO','BA','BW','BV','BR','IO','BN','BG','BF','BI','KH','CM','CA','CV','KY','CF','TD','CL','CN','CX','CC','CO','KM','CG','CD','CK','CR','CI','HR','CU','CY','CZ','DK','DJ','DM','DO','EC','EG','SV','GQ','ER','EE','ET','FK','FO','FJ','FI','FR','GF','PF','TF','GA','GM','GE','DE','GH','GI','GR','GL','GD','GP','GU','GT','GG','GN','GW','GY','HT','HM','VA','HN','HK','HU','IS','IN','ID','IR','IQ','IE','IM','IL','IT','JM','JP','JE','JO','KZ','KE','KI','KR','KW','KG','LA','LV','LB','LS','LR','LY','LI','LT','LU','MO','MK','MG','MW','MY','MV','ML','MT','MH','MQ','MR','MU','YT','MX','FM','MD','MC','MN','ME','MS','MA','MZ','MM','NA','NR','NP','NL','AN','NC','NZ','NI','NE','NG','NU','NF','MP','NO','OM','PK','PW','PS','PA','PG','PY','PE','PH','PN','PL','PT','PR','QA','RE','RO','RU','RW','BL','SH','KN','LC','MF','PM','VC','WS','SM','ST','SA','SN','RS','SC','SL','SG','SK','SI','SB','SO','ZA','GS','ES' |
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
function getPosition(element){ | |
for(var lx = 0, ly = 0; element != null; lx += element.offsetLeft, ly += element.offsetTop, element = element.offsetParent); | |
return {x: lx, y: ly}; | |
} |
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
function removeClass(element, cls){ | |
if(typeof element.classList !== "undefined"){ | |
element.classList.remove(cls); | |
return element; | |
} else { | |
if(element.className.indexOf(cls) != -1){ | |
element.className = element.className.replace(cls, ''); | |
} | |
return element; | |
} |
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
function addClass(element, cls){ | |
if(typeof element.classList !== "undefined"){ | |
element.classList.add(cls); | |
} else { | |
element.className += element.className.indexOf(cls) == -1 ? cls : ' ' + cls; | |
} | |
return element; | |
} |
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
<link rel="stylesheet" href="style.css" media="all"> | |
<link rel="stylesheet" href="style.tablet.css" media="all and (min-width: 570px)"> | |
<link rel="stylesheet" href="style.desktop.css" media="all and (min-width: 960px)"> | |
<!--[if (lt IE 9) & (!IEMobile)]> | |
<link rel="stylesheet" href="style.tablet.css" media="all"> | |
<link rel="stylesheet" href="style.desktop.css" media="all"> | |
<![endif]--> |
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 h = (function(b, d){ | |
return Math.max(b.scrollHeight, b.offsetHeight, d.clientHeight, d.scrollHeight, d.offsetHeight); | |
})(document.body, document.documentElement); |
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
<!--[if lte IE 8]> <link rel="stylesheet" href="css/libs/normalize.1.1.2.min.css"> <![endif]--> | |
<!--[if gt IE 8]> <!--> <link rel="stylesheet" href="css/libs/normalize.2.1.2.min.css"> <!--<![endif]--> |
NewerOlder