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 | |
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
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
/* 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
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
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
.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
.preloader { | |
display: inline-block; | |
position: relative; | |
-webkit-transition: all 0.5s ease; | |
transition: all 0.5s ease; | |
} | |
.item { | |
width: 30px; | |
height: 30px; |
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
/* Serialize names for cases when: | |
JESÚS ALBERTO POLO GARCÍA or POLO GARCÍA, JESÚS ALBERTO | |
I want the first one, then I modify the original String for get the first from the second (when necessary) | |
POLO GARCIA, JESUS ALBERTO -> JESUS ALBERTO POLO GARCIA */ | |
function serializeName(name) { | |
if (name.indexOf(',') > -1) { | |
var reversed = name.split(","); | |
reversed[0] = reversed[0].trim(); | |
reversed[1] = reversed[1].trim(); |
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
# Joyent instructions (https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#debian-and-ubuntu-based-linux-distributions) | |
# Download from the source | |
curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash - | |
# Installing node directly (latest version) | |
sudo apt-get install --yes nodejs | |
# Build tools for npm | |
sudo apt-get install --yes build-essential |
OlderNewer