Skip to content

Instantly share code, notes, and snippets.

View JeancarloFontalvo's full-sized avatar

Jeancarlo Fontalvo (Jeancaseven) JeancarloFontalvo

View GitHub Profile
@JeancarloFontalvo
JeancarloFontalvo / export-named-sheet-as-csv.gs
Created January 28, 2019 20:56 — forked from mrkrndvs/export-named-sheet-as-csv.gs
Google apps script to export an individual sheet as csv file
/*
* script to export data of the named sheet as an individual csv files
* sheet downloaded to Google Drive and then downloaded as a CSV file
* file named according to the name of the sheet
* original author: Michael Derazon (https://gist.github.com/mderazon/9655893)
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var csvMenuEntries = [{name: "Download Primary Time File", functionName: "saveAsCSV"}];
@JeancarloFontalvo
JeancarloFontalvo / validator.gist.gs
Created January 28, 2019 22:59
Formula for validating a cell with the J2 Format
-- J2 = "Alfanumerico|6|SI|SI|Personalizado"
--FORMULA
=Y(
SI(
SI.ERROR(HALLAR("Alfa"; J2); -1) <> -1;
VERDADERO;
SI(
SI.ERROR(HALLAR("Numerico"; J2); -1) <> -1;
REGEXMATCH(TO_TEXT(K2); "^(\d+)$");
@JeancarloFontalvo
JeancarloFontalvo / checkbox-textual.gist.js
Created January 28, 2019 23:06
Append a label next to each checkboxes
var checkboxes = $('input[type="checkbox"]');
checkboxes.each((item, element) => {
element = $(element);
var value = element.is(":checked");
element.after(`<span class='text-white label label-${value ? "primary": "danger"}'>${value ? "SI": "NO"}</span>`);
})