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
/* It returns only the first match || null */ | |
var $ = document.querySelector.bind(document); | |
/* Ex: $('a.link') */ |
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
#!/usr/bin/python | |
import requests | |
import urllib2 | |
# Current cookies (use 'document.cookie' in Console to get them) | |
cookies = '' | |
# Create a dict from that given ookies | |
cookies = dict(item.split("=", 1) for item in cookies.split("; ")) | |
# Files to be downloaded (paste them manually, use 'Copy link address'). Be careful to add ',' at the end of each line unless last |
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
# SCP (Secure Copy, over SSH) | |
# Local to server | |
scp /path/to/retrieve user@domain.com:/path/to/save | |
# Server to local | |
scp user@domain.com:/path/to/retrieve /path/to/save | |
# Server to server | |
scp user@domain.com:/path/to/retrieve user2@domain2.com:/path/to/save |
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
/* Idea from http://stackoverflow.com/a/14205994/4296439 */ | |
$input-background-color: white; | |
input:-webkit-autofill { | |
-webkit-box-shadow: 0 0 0 1000px $input-background-color inset; | |
box-shadow: 0 0 0 1000px $input-background-color inset; | |
} |
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://stackoverflow.com/questions/22211755/function-f-if-this-instanceof-f-return-new-f, | |
If constructor is called without 'new' keyword before, it returns a new instance of the object. */ | |
function MyObject(foo){ | |
if (!(this instanceof MyObject)){ | |
return new MyObject(foo); | |
} | |
this.bar = foo; | |
} |
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 sendRequest(method, targetURL, content, callback) { | |
var http = new XMLHttpRequest(), | |
message = (content !== undefined) ? JSON.stringify(content) : undefined; | |
http.open(method, targetURL, true); | |
if (message !== undefined) { /* GET requests may not have JSON content */ | |
http.setRequestHeader('Content-type', 'application/json; charset=utf-8'); | |
} |
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
Documentation: https://support.comodo.com/index.php?/Default/Knowledgebase/Article/View/620/1/which-is-root-which-is-intermediate | |
Certification chain: | |
-UserTrust / AddTrust External Root | |
-COMODO RSA Certification Authority | |
-COMODO RSA Domain Validation Secure Server CA | |
-End-Entity/Domain Certificate | |
Bundle is created by certificates in reversing order (Domain Certificate first!). |
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 |
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
.preloader { | |
display: inline-block; | |
position: relative; | |
-webkit-transition: all 0.5s ease; | |
transition: all 0.5s ease; | |
} | |
.item { | |
width: 30px; | |
height: 30px; |