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
.preloader { | |
display: inline-block; | |
position: relative; | |
} | |
.preloader-item { | |
-webkit-animation: anim-preloader-item 1s ease-in-out infinite alternate; | |
animation: anim-preloader-item 1s ease-in-out infinite alternate; | |
background: #2ecc71; | |
border-radius: 50%; |
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 sanitizeFileName(name) { | |
return name | |
.replace(/ /g, '-') /* Spaces as - (slug...) */ | |
.replace(/[^A-Za-z0-9-_\.]/g, '') /* Only letters, numbers and symbols: - _ . */ | |
.replace(/\.+/g, '.') /* .. or more -> . */ | |
.replace(/-+/g, '-') /* -- or more -> - */ | |
.replace(/_+/g, '_'); /* __ or more -> _ */ | |
} |
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 weekdays = ('Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday').split('|'); | |
var months = ('January|February|March|April|May|June|July|August|September|October|November|December').split('|'); | |
/* if weeks start on Monday... (var weekdays was declared before in global scope) */ | |
function weekStartsOnMonday() { | |
var sunday = weekdays.shift(); | |
weekdays.push(sunday); | |
} |
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
/* Forked from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random */ | |
/* This function returns a random integer between two numbers, both included (min - max) */ | |
function getRandomInteger(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} | |
/* var random = getRandomInteger(0, 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
function setLocalStorage(key, value) { | |
if (typeof value == 'object') { | |
value = JSON.stringify(value); | |
} | |
localStorage.setItem(key, value); | |
} | |
function getLocalStorage(key) { | |
var value = localStorage.getItem(key); |
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
/* Get and set cookies 'manually' */ | |
function setCookie(cookieName, value, expirationYears) { | |
var CookieDate = new Date; | |
CookieDate.setFullYear(CookieDate.getFullYear() + expirationYears); | |
document.cookie = cookieName + '=' + value + '; expires=' + CookieDate.toGMTString( ) + ';'; | |
} | |
function getCookie(cookieName) { | |
var currentCookie, |
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
#Send HTTP commands in SSL connections (like telnet) | |
#Standard command | |
openssl s_client -connect www.google.com:443 | |
# Handshake doesn't mind | |
openssl s_client -quiet -connect www.google.com:443 | |
NewerOlder