Skip to content

Instantly share code, notes, and snippets.

View Strusovsky's full-sized avatar

Andrew Strusovsky Strusovsky

View GitHub Profile
@tanaikech
tanaikech / submit.md
Last active May 13, 2023 04:31
Issue of HTML form with Input tab of Type File with google.script.run

Issue of HTML form with Input tab of Type File with google.script.run

Today, I discussed with Riël Notermans an issue with the HTML form with the input tab of type="file" with google.script.run. Through this discussion, the reason for this issue could be found. When you use the input tab of type="file" in the HTML form, and you want to send the file content with google.script.run, I thought that this post might be useful for other users. So, I posted it here.

A simple sample script for replicating this issue is as follows.

Sample script

Google Apps Script Code.gs

@harunpehlivan
harunpehlivan / index.html
Created June 5, 2021 23:02
Multi Modal Profile Card Bootstrap
<head>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<link href='https://fonts.googleapis.com/css?family=Lato:400,300' rel='stylesheet' type='text/css'>
</head>
<body>
@thealchen
thealchen / 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() {
@Strusovsky
Strusovsky / main.js
Created January 30, 2021 18:40 — forked from webag/main.js
UTM to forms
/**************************************************
UTM to forms
***************************************************/
$(document).ready(function(){
if ('localStorage' in window) {
if (urlParams('utm_source') != null ||
urlParams('utm_medium') != null ||
urlParams('utm_content') != null ||
urlParams('utm_campaign') != null ||
/*
Function to create a Calendar Event via the API and include Google Meet.
Enable the API via: Services > Google Calendar API > Add
https://developers.google.com/calendar/v3/reference/events/insert#parameterss
*/
/**
* The time manager manages the time in your script. The timemanager keeps track of
* the time spend and can tell you how much time is left.
*
* This manager is usefull in background scripts that will be killed by apps script
* after some time. Every time before starting an operation you can see if you can
* acquire time to perform the operation. If there is not enough time left you can
* exit the program gracefully.
*
* @param {object} spec - specification for the construction of the object
@tanaikech
tanaikech / submit.md
Last active September 7, 2025 00:03
Uploading File to Google Drive from External HTML without Authorization

Uploading File to Google Drive from External HTML without Authorization

This is a sample script for uploading a file to Google Drive from the external HTML without the authorization. In this case, the client side can be used at the outside of Google. And as the server side, the Web Apps created by Google Apps Script is used.

Usage

Please do the following flow.

1. Create new project of Google Apps Script.

const NodeCache = require("node-cache");
const cache = new NodeCache();
const Coda = require('coda-js').default;
const bearer = process.env.CODA_API_TOKEN;
const coda = new Coda(bearer);
const docId = "XXXXX";
var router = require('express').Router();
/* Move help button to the top */
.help_button--button--4Ly1iuWp {
top: 22px;
}
@gjroelofs
gjroelofs / CSS TOC - Coda
Created October 12, 2019 14:07
CSS for automatic TOC creation for Coda
/** Table of Contents. **/
#toc {
position: fixed;
display: table;
padding: 10px;
border: 1px solid #a2a9b1;
background-color: white;
padding: 5px;
font-size: 95%;