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
[{ | |
"cod": 1, | |
"name": "ACTIVO", | |
"level": 0, | |
"parent_id": null, | |
"type": 1, | |
"load_as": 1 | |
}, | |
{ | |
"cod": 11, |
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
:root { | |
--main-color: #233DF9; | |
--primary-color: #233df9; | |
--primary-font-color: #FFF; | |
--primary-border-color: #b5bdf9; | |
--primary-light-color: #F2F3FF; | |
--primary-transparent-color: #233df90F; | |
--seconday-color: #000000; |
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
dragElement(document.getElementsByClassName("btn-group")[0]); | |
function dragElement(elmnt) { | |
var pos1 = 0, | |
pos2 = 0, | |
pos3 = 0, | |
pos4 = 0; | |
if (document.getElementsByClassName(elmnt.className + "-header")[0]) { | |
// if present, the header is where you move the DIV from: | |
document.getElementsByClassName(elmnt.className + "-header")[0].onmousedown = dragMouseDown; |
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 paginate(array, page_size, page_number) { | |
// human-readable page numbers usually start with 1, so we reduce 1 in the first argument | |
return array.slice((page_number - 1) * page_size, page_number * page_size); | |
} | |
console.log(paginate([1, 2, 3, 4, 5, 6], 2, 2)); | |
console.log(paginate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 4, 1)); |
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
const rows = [ | |
["name1", "city1", "some other info"], | |
["name2", "city2", "more info"] | |
]; | |
let csvContent = "data:text/csv;charset=utf-8," + rows.map(e => e.join(",")).join("\n"); | |
var encodedUri = encodeURI(csvContent); | |
var link = document.createElement("a"); | |
link.setAttribute("href", encodedUri); |
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
import java.time.LocalDate; | |
// New calendar instance | |
Calendar calendar = GregorianCalendar.getInstance(); | |
LocalDate dt = LocalDate.parse("2020-01-15"); | |
Integer day = 0, month = 0, year = 0; | |
year = dt.getYear(); |
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 run = () => { | |
var birth = new Date("1999-3-22"); | |
var curr = new Date(); | |
var diff = curr.getTime() - birth.getTime(); | |
console.log("Edad: " + Math.floor(diff / (1000 * 60 * 60 * 24 * 365.25))); | |
} | |
run(); |
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
document.head.appendChild(Object.assign( | |
document.createElement('script'), | |
{ src: 'https://momentjs.com/downloads/moment-with-locales.js' } | |
)); | |
// Example | |
console.log(moment("2011-10-31", "YYYY-MM-DD").format('DD/MM/YYYY')); |
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
[ | |
{ | |
"CODPROFESI": 1, | |
"DESPROFESI": "ABOGADO" | |
}, | |
{ | |
"CODPROFESI": 2, | |
"DESPROFESI": "AEROTECNICO" | |
}, | |
{ |
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
[ | |
{ | |
"DESCIUDAD": "AHUACHAPAN", | |
"CODDEPTO": 1, | |
"CODCIUDAD": 1 | |
}, | |
{ | |
"DESCIUDAD": "APANECA", | |
"CODDEPTO": 1, | |
"CODCIUDAD": 2 |
NewerOlder