This is the source code of one of my blog post. To read the full blog post please click here.
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
import { Module } from '@nestjs/common'; | |
import { AppController } from './app.controller'; | |
import { AppService } from './app.service'; | |
import { PluginModule } from './plugin/plugin.module'; | |
@Module({ | |
imports: [PluginModule.registerPluginsAsync()], | |
controllers: [AppController], | |
providers: [AppService], | |
}) |
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
http://www.gstatic.com/images/icons/material/apps/weather/2x/wintry_mix_rain_snow_light_color_96dp.png | |
http://www.gstatic.com/images/icons/material/apps/weather/2x/haze_fog_dust_smoke_light_color_96dp.png | |
http://www.gstatic.com/images/icons/material/apps/weather/2x/cloudy_light_color_96dp.png | |
http://www.gstatic.com/images/icons/material/apps/weather/2x/snow_showers_snow_light_color_96dp.png | |
http://www.gstatic.com/images/icons/material/apps/weather/2x/flurries_light_color_96dp.png |
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 count = 0; | |
function myFunction() { | |
Logger.log('Starting'); | |
// Please Write the path of the folder you want sub path seperated with slash(,) (spaces are counted) | |
// for example: for myFolder/test -> myFolder,test | |
// And NOT myFolder, test | |
var folders = []; | |
if(!folders) { |
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
function extractTextOnOpen() { | |
//ADD YOUR VALUES BELOW | |
var folderName = "[YOUR PROJECT FOLDER]"; | |
var sheetId = "[YOUR SHEET ID]"; | |
//Define folder | |
var folder = DriveApp.getFoldersByName(folderName).next(); | |
var folderId = folder.getId(); |
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
// Insert thumbnails of your Drive image files into a Google Sheet. | |
// Images are inserted directly into the cells of the sheet, not as those useless overlays that float around. | |
// | |
// This is set up to scan the first two columns of the active sheet. Column A will contain an =IMAGE(url) formula, which is calculated by finding the image thumbnail for the file referred to by column B. | |
// While this is simply the code I used for my own particular purpose, you can easily adapt it for your own needs. Please note that while an onEdit() version of this script would be cool, it will not work. | |
// Formulas cannot access most other Google Apps services, though you could probably use a data store if you felt ambitious enough. | |
// Note: the Drive Advanced API must be activated for this script to work. | |
// | |
// The script looks for files based on the pattern below: |
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
function getDataFromXpath(path, url) { | |
var data = UrlFetchApp.fetch(url); | |
var text = data.getContentText(); | |
var xmlDoc = Xml.parse(text, true); | |
// Replacing tbody tag because app script doesnt understand. | |
path = path.replace("/html/","").replace("/tbody","","g"); | |
var tags = path.split("/"); | |
Logger.log("tags : " + tags); | |
// getting the DOM of HTML |
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
/** | |
* Retrieve a file from the given URL, store into the named folder | |
* on Google Drive. | |
* | |
* @param {String} fileURL URL to source file, e.g. "http://mysite.com/files/file.val1.val22.zip" | |
* @param {String} folder Name of target folder on Google Drive | |
* | |
* @returns {Object} Response of operation, e.g. | |
* {rc:200,fileName:"test.zip",fileSize:92994392} | |
*/ |