Skip to content

Instantly share code, notes, and snippets.

View Falciighol's full-sized avatar
📷
Say JS!

Juampa Falciighol

📷
Say JS!
View GitHub Profile
@Falciighol
Falciighol / Accounts.json
Last active June 14, 2021 22:48
[Cuentas] Listado de cuentas sistema contable #bonita #siscontable
[{
"cod": 1,
"name": "ACTIVO",
"level": 0,
"parent_id": null,
"type": 1,
"load_as": 1
},
{
"cod": 11,
@Falciighol
Falciighol / style.css
Last active July 29, 2021 21:16
[Sis. Contable Style] Default style #bonita #siscontable
: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;
@Falciighol
Falciighol / dragElement.js
Created March 16, 2020 22:59
[Draggable Element] Draggable HTML element script. #js #javascript
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;
@Falciighol
Falciighol / arrayPagination.js
Created March 13, 2020 22:15
[Array pagination] Slice an array with the page size and page number params #javascript #js
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));
@Falciighol
Falciighol / csvCreator.js
Created March 10, 2020 04:01
[CSV from Array]
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);
@Falciighol
Falciighol / timerDate.groovy
Created January 14, 2020 22:02
[Timer Date] Set and return the timer date in Bonita #groovy #bp #bonita
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();
@Falciighol
Falciighol / ageCalc.js
Created January 13, 2020 22:17
[Age Calculator] Javascipt age calculator script #js
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();
@Falciighol
Falciighol / consoleScriptCall.js
Created November 12, 2019 21:45
[Console Script Call] Call an external or local script from console #js #bp
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'));
@Falciighol
Falciighol / professions.json
Created October 30, 2019 19:25
[Professions List] Professions list in spanish #json #bp #list
[
{
"CODPROFESI": 1,
"DESPROFESI": "ABOGADO"
},
{
"CODPROFESI": 2,
"DESPROFESI": "AEROTECNICO"
},
{
@Falciighol
Falciighol / svMunicipalities.json
Created October 30, 2019 15:47
[El Salvador Municipalities] El Salvador municipalities list #json #list #bp
[
{
"DESCIUDAD": "AHUACHAPAN",
"CODDEPTO": 1,
"CODCIUDAD": 1
},
{
"DESCIUDAD": "APANECA",
"CODDEPTO": 1,
"CODCIUDAD": 2