Skip to content

Instantly share code, notes, and snippets.

@imthenachoman
imthenachoman / Developing a GAS Powered Google Workspace Add-on And Launching It To The Marketplace.md
Last active June 24, 2024 15:49
Developing a GAS Powered Google Workspace Add-on And Launching It To The Marketplace
/* https://go.tacodewolff.nl/minify */
enScroll=!1,enFdl=!1,extCurrent=void 0,filename=void 0,targetText=void 0,splitOrigin=void 0;const lStor=localStorage,sStor=sessionStorage,doc=document,docEl=document.documentElement,docBody=document.body,docLoc=document.location,w=window,s=screen,nav=navigator||{},extensions=["pdf","xls","xlsx","doc","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpe","mpeg","wmv","mid","midi","mp3","wav","wma"];function a(e,t,n,o){const j="G-XXXXXXXXXX",r=()=>Math.floor(Math.random()*1e9)+1,c=()=>Math.floor(Date.now()/1e3),F=()=>(sStor._p||(sStor._p=r()),sStor._p),E=()=>r()+"."+c(),_=()=>(lStor.cid_v4||(lStor.cid_v4=E()),lStor.cid_v4),m=lStor.getItem("cid_v4"),v=()=>m?void 0:enScroll==!0?void 0:"1",p=()=>(sStor.sid||(sStor.sid=c()),sStor.sid),O=()=>{if(!sStor._ss)return sStor._ss="1",sStor._ss;if(sStor.getItem("_ss")=="1")return void 0},a="1",g=()=>{if(sStor.sct)if(enScroll==!0)return sStor.sct;else x=+sStor.getItem("sct")+ +a,sSto
@al-codaio
al-codaio / loading_bar.js
Created April 13, 2021 18:19
Create a loading bar while you're retrieving results from an API with Google Apps Script
// Create a loading bar in your Google Sheet using Google Apps Script
// Author: Al Chen (al@coda.io)
// Last Updated: April 13th, 2021
// Notes: Assumes you are using the V8 runtime (https://developers.google.com/apps-script/guides/v8-runtime)
// Example Google Sheet: https://docs.google.com/spreadsheets/d/1ngvYKEMunqCVufR10rlK42iENAERp-uyiPN_aiq-MKo/edit?usp=sharing
SOURCE_SHEET_ID = 'YOUR_GOOGLE_SHEETS_ID'
SOURCE_WORKSHEET_NAME = 'YOUR_WORKSHEET_NAME'
function loop() {
@tanaikech
tanaikech / submit.md
Last active May 6, 2024 02:34
Redeploying Web Apps without Changing URL of Web Apps for new IDE

Redeploying Web Apps without Changing URL of Web Apps for new IDE

At March 15, 2021, one endpoint is created for one deployment. Ref By this, when you redeploy "Web Apps", the endpoint is changed. Because the deployment ID is changed. It seems that this it the new specification. In this report, I would like to introduce the method for redeploying Web Apps without changing the URL of Web Apps for new IDE.

Deploy Web Apps

  1. Open "New deployment" dialog with "Deploy" -> "New deployment".

  2. Select "Web app" for "Select type".

@tanaikech
tanaikech / submit.md
Last active November 20, 2023 21:50
Copying Protections for Spreadsheet using Google Apps Script

Copying Protections for Spreadsheet using Google Apps Script

This is a sample script for copying the protections for Spreadsheet using Google Apps Script. When several protections of the sheet protection and the range protection are set to a Google Spreadsheet and the Spreadsheet is copied using the script and the manual copy with the browser, unfortunately, the protections of ranges are not copied. And also, the protections of sheets can be copied. But, the editor emails are not included. It seems that this is the current specification.

In this post, I would like to introduce a sample script for copying all protection conditions.

Sample script

Please add the following function to your script. And, please enable Sheets API at Advanced Google services.

@kurokobo
kurokobo / docker-compose-installer-for-container-optimized-os-on-gce.md
Last active July 18, 2024 15:54
Simple Installer for Docker Compose on Container-Optimized OS on Google Computing Engine

Simple Installer for Docker Compose on Container-Optimized OS on Google Computing Engine

The easiest way to make Docker Compose available on Container-Optimized OS on Google Compute Engine (GCE) on Google Cloud Platform (GCP).

This is minimal Bash script version of Community Tutorial.

How to use

Simply, download installer.sh, run it, and then reload bash by source ~/.bashrc or re-login.

https://jennamolby.com/how-to-use-cookies-to-capture-url-parameters/
let YOUR_DOMAIN = "YOUR_DOMAIN.TLD" // ex: scrapingbee.com
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
@tanaikech
tanaikech / submit.md
Last active May 10, 2024 06:46
Sample Scripts for Requesting to Web Apps by Various Languages
@stravant
stravant / FooBar.lua
Last active July 26, 2020 22:18
Lua class template
local FooBar = {}
FooBar.__index = FooBar
function FooBar.new()
local this = {
_privateVariable = 137,
}
return setmetatable(this, FooBar)
end
@schlosser
schlosser / google-sheets-to-firebase.gs
Last active January 10, 2022 03:42
Copy your Google Sheets spreadsheet to Firebase using this AppScript.
// Installation & Setup
// 1. Create a spreadsheet.
// 2. Under Tools > Script Editor, paste this script
// 3. Under Resources > Libraries, add two library dependencies:
// - OAuth2: 1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF
// - FirebaseApp: 1hguuh4Zx72XVC1Zldm_vTtcUUKUA6iBUOoGnJUWLfqDWx5WlOJHqYkrt
// 4. Create a Firebase project and initialize the Realtime Database
// 5. Fill in your project details in FIREBASE_IO_URL and SERVICE_ACCOUNT below.
// 6. Under Resources > Cloud Platform Project, add your Firebase project's project number from GCP. You
// can find your project number in the GCP Cloud Console here: https://console.cloud.google.com/home/dashboard?project=_