Skip to content

Instantly share code, notes, and snippets.

View iTrauco's full-sized avatar

Christopher Trauco iTrauco

View GitHub Profile
@iTrauco
iTrauco / send_email.py
Created January 26, 2023 02:11 — forked from azmirfakkri/send_email.py
Email automation using Python and Google Sheet
# we need these modules to send the emails
import smtplib
import ssl
# these modules will allow you to create the client and interact
# with Google Sheet
import gspread
from oauth2client.service_account import ServiceAccountCredentials
# these modules will help you create the HTML emails
@tanaikech
tanaikech / submit.md
Created December 7, 2022 06:00
Workaround: Reflecting Latest Script to Deployed Web Apps Created by Google Apps Script without Redeploying

Workaround: Reflecting Latest Script to Deployed Web Apps Created by Google Apps Script without Redeploying

This report is a workaround for reflecting the latest Google Apps Script to the deployed Web Apps without redeploying.

Pattern 1

Of course, when the developer mode of https://script.google.com/macros/s/###/dev is used, the latest script can be used without redeploying.

But, in this case, only the permitted users can use it using the access token. when you want to achieve this using the endpoint of https://script.google.com/macros/s/###/exec without the access token, in order to reflect the latest script to Web Apps, it is required to redeploy. As another pattern, I would like to introduce a workaround for this situation.

@iTrauco
iTrauco / README.md
Created November 30, 2022 04:55 — forked from richardblondet/README.md
Create a simple API backend with Google App Script and a Spreadsheet

Google App Script CRUD

Inspired by this gist.

Getting Started

  1. Create a new App Script project.
  2. Paste the content of the file google-app-script-crud.gs in the default Code.gs file.
  3. Create a new Spreadsheet.
  4. Copy the Spreadsheet ID found in the URL into the variable SHEET_ID located in line 1 of your file.
@iTrauco
iTrauco / sample.ipynb
Created November 2, 2022 04:59 — forked from egradman/sample.ipynb
Simple Google Spreadsheets to Pandas DataFrame in IPython Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iTrauco
iTrauco / exportSpreadsheet.gs
Created October 6, 2022 02:46 — forked from Spencer-Easton/exportSpreadsheet.gs
Example on how to export a Google sheet to various formats, includes most PDF options
function exportSpreadsheet() {
//All requests must include id in the path and a format parameter
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export
//FORMATS WITH NO ADDITIONAL OPTIONS
//format=xlsx //excel
//format=ods //Open Document Spreadsheet
//format=zip //html zipped
@tanaikech
tanaikech / submit.md
Last active February 9, 2025 15:55
Creating Quizzes in Google Form using Google Forms API with Google Apps Script

Creating Quizzes in Google Form using Google Forms API with Google Apps Script

This is a sample script for creating quizzes in Google Form using Google Forms API with Google Apps Script. Recently, Google Forms API has been officially published, and it got to be able to be used by users. By this, quizzes in Google Form can be created using Google Forms API.

Here, there is one thing that can be achieved by Google Forms API. When Google Forms API is used, each choice in each question can be shuffled. This cannot be achieved with Google Forms Service (FormApp).

Usage

@iTrauco
iTrauco / show_ssl_expire
Created April 1, 2022 04:34 — forked from bmatthewshea/show_ssl_expire
Retrieve/Check SSL certificate expiration date(s)
#!/bin/bash
# By B Shea Dec2018 & Mar2020
# https://www.holylinux.net
# Test for OpenSSL - if not installed stop here.
if ! [[ -x $(which openssl) ]]; then
printf "\nOpenSSL not found or not executable.\nPlease install OpenSSL before proceeding.\n\n"
exit 1
fi
@Code-Hex
Code-Hex / gcp-roles.js
Last active August 11, 2022 01:02
Get GCP IAM Roles
const cheerio = require('cheerio');
const fetch = require('node-fetch');
const fs = require('fs');
// roles["roles/accesscontextmanager.policyAdmin"]["en"]
const roles = {};
async function makePredefinedRoles(locale) {
const response = await fetch(
`https://cloud.google.com/iam/docs/understanding-roles?hl=${locale}`
@iTrauco
iTrauco / separator.py
Created February 25, 2021 18:01 — forked from jlln/separator.py
Efficiently split Pandas Dataframe cells containing lists into multiple rows, duplicating the other column's values.
def splitDataFrameList(df,target_column,separator):
''' df = dataframe to split,
target_column = the column containing the values to split
separator = the symbol used to perform the split
returns: a dataframe with each entry for the target column separated, with each element moved into a new row.
The values in the other columns are duplicated across the newly divided rows.
'''
def splitListToRows(row,row_accumulator,target_column,separator):
split_row = row[target_column].split(separator)
@iTrauco
iTrauco / Code.gs
Created January 30, 2021 13:12 — forked from primaryobjects/Code.gs
Export a Google Drive spreadsheet to PDF in Google Drive in the same folder.
// Simple function to add a menu option to the spreadsheet "Export", for saving a PDF of the spreadsheet directly to Google Drive.
// The exported file will be named: SheetName and saved in the same folder as the spreadsheet.
// To change the filename, just set pdfName inside generatePdf() to something else.
// Running this, sends the currently open sheet, as a PDF attachment
function onOpen() {
var submenu = [{name:"Save PDF", functionName:"generatePdf"}];
SpreadsheetApp.getActiveSpreadsheet().addMenu('Export', submenu);
}