This file contains hidden or 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
| -- Source: https://mysqlstepbystep.com/2017/04/24/handy-stored-procedure-for-regular-dba-tasks/ | |
| DROP PROCEDURE IF EXISTS `reorganize_tables`; | |
| DELIMITER // | |
| CREATE PROCEDURE `reorganize_tables` (`db_name` VARCHAR(64)) | |
| BEGIN | |
| DECLARE `v_finished` BOOL DEFAULT FALSE; | |
| DECLARE `tbl_name` VARCHAR(64) DEFAULT ''; |
This file contains hidden or 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
| /* Need to install common_schema - code.google.com/p/common-schema/ */ | |
| /* Procedure structure for procedure `explode1` */ | |
| /*!50003 DROP PROCEDURE IF EXISTS `explode1` */; | |
| DELIMITER $$ | |
| /*!50003 CREATE PROCEDURE `explode1`(str varchar(65500), delim VARCHAR(255)) | |
| BEGIN |
This file contains hidden or 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
| /* CODE FOR DEMONSTRATION PURPOSES */ | |
| function getAvailableTags() { | |
| var ss = SpreadsheetApp.openById([SS-ID]); | |
| var s = ss.getSheetByName([S-NAME]); | |
| var data = s.getDataRange().getValues(); | |
| var headers = 1; // number of header rows to skip at top | |
| var tagColumn = 2; // column # (0-based) containing tag | |
| var availableTags = [], availableTag; | |
| for (var row = headers, len = data.length; row < len; row++) { |
This file contains hidden or 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
| /* | |
| In the Form, create new trigger: | |
| Run: onFormSubmit | |
| Events: From form | |
| On form submit | |
| Runs for new / edit responses | |
| */ | |
| /* CODE FOR DEMONSTRATION PURPOSES */ |
This file contains hidden or 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
| /* CODE FOR DEMONSTRATION PURPOSES */ | |
| function getFileById_(idFile) { | |
| return DocsList.getFileById(idFile); | |
| } | |
| function getFolderById_(idFolder) { | |
| return DocsList.getFolderById(idFolder); | |
| } |
This file contains hidden or 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 _STRING = "string", _ARRAY = "array", _HELLO = "Hola", _SPACE = " "; | |
| function toType(obj) { | |
| //return ({}).toString.call(obj).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(); | |
| //Expresión regular mejorada | |
| //return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); | |
| // Usando el "slice" | |
| return ({}).toString.call(obj).slice(8,-1).toLowerCase(); |
This file contains hidden or 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
| /* | |
| .isArray | |
| Implemented in: JavaScript 1.8.5 | |
| ECMAScript Edition: ECMAScript 5th Edition | |
| MDN Docs http://goo.gl/AjneU | |
| */ | |
| /* From MDN Docs http://goo.gl/AjneU */ | |
| if(!Array.isArray) { | |
| Array.isArray = function (arg) { | |
| return Object.prototype.toString.call(arg) == '[object Array]'; |
This file contains hidden or 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
| /* | |
| .isArray | |
| Implemented in: JavaScript 1.8.5 | |
| ECMAScript Edition: ECMAScript 5th Edition | |
| MDN Docs http://goo.gl/AjneU | |
| */ | |
| /* From MDN Docs http://goo.gl/AjneU */ | |
| if(!Array.isArray) { | |
| Array.isArray = function (arg) { | |
| return Object.prototype.toString.call(arg) == '[object Array]'; |