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 urlToArray(url = '') { | |
var request = {}, | |
pairs, | |
i, | |
pair; | |
if (url === '') { | |
url = window.location; | |
} | |
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 ArrayToURL(array) { | |
var pairs = []; | |
for (var key in array) | |
if (array.hasOwnProperty(key)) | |
pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(array[key])); | |
return pairs.join('&'); | |
} |
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
// Return an array | |
function get_object_values(obj) { | |
'use strict'; | |
return Object.keys(obj).map(function (k) { | |
return obj[k]; | |
}); | |
} | |
var object_values = get_object_values({key1: "value1", key2: "value2", key3: "value3"}); |
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
# Add the remote, call it "upstream": | |
git remote add upstream https://github.com/whoever/whatever.git | |
# Fetch all the branches of that remote into remote-tracking branches, | |
# such as upstream/master: | |
git fetch upstream | |
# Make sure that you're on your master branch: |
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
window.console.time("answer time"); | |
window.alert("Click to continue"); | |
window.console.timeEnd("answer time"); |
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
SELECT `campo1`,`campo2`, MATCH (`campo1`,`campo2`) | |
AGAINST ('"cadena a buscar*"' IN BOOLEAN MODE) AS Relevancia | |
FROM `tabla1` | |
WHERE MATCH (`campo1`,`campo2`) | |
AGAINST ('"cadena a buscar*"' IN BOOLEAN MODE) | |
HAVING Relevancia >= 0.5 | |
ORDER BY Relevancia DESC | |
LIMIT 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 htmlEncode(value){ | |
//create a in-memory div, set it's inner text(which jQuery automatically encodes) | |
//then grab the encoded contents back out. The div never exists on the page. | |
return $('<div/>').text(value).html(); | |
} | |
function htmlDecode(value){ | |
return $('<div/>').html(value).text(); | |
} |
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://jsfiddle.net/odxg8tfu/ |
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
https://jsfiddle.net/erknrio/c4akywzk/ |
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
# Comandos vim | |
# https://gist.github.com/erknrio/0c7723562ec809f6e7310600470c5eea | |
# Comprobar tamaño completo de carpeta | |
du -h | |
# Comprobar el tamaño del disco | |
df -h | |
# Consultar la ayuda |