Skip to content

Instantly share code, notes, and snippets.

View JayGoldberg's full-sized avatar

Jay Goldberg JayGoldberg

  • Google
  • San Francisco, CA, USA
View GitHub Profile
@matt17r
matt17r / (Sample) Map of Shared Drive.md
Last active December 5, 2024 15:57
Generate a tree view of Google Shared Drives in Markdown format
/*
######
# # # ###### ##### ##### #### # #
# # # # # # # # # # #
###### # ##### # ##### # # ##
# # # # # # # # ##
# # # # # # # # # #
# # ###### # ##### #### # #
@slaporte
slaporte / Code.gs
Created November 15, 2020 00:46
Google Apps Script to send an email (from a Doc template) based on a response to a form. Used for Wiki Loves Monuments email confirmation.
/**
* Based on: https://github.com/googleworkspace/solutions/blob/master/content-signup/src/Code.js
*/
var EMAIL_TEMPLATE_DOC_URL = 'https://docs.google.com/document/d/***/edit?usp=sharing';
var EMAIL_SUBJECT = '[Response requested] Please confirm your Wiki Loves Monuments winners';
var CC_RECIPIENTS = '[email protected], [email protected]'
/**
* Installs a trigger on the Spreadsheet for when a Form response is submitted.
@iamdaniele
iamdaniele / Tweet functions.gs
Last active February 12, 2023 05:40
Add public metrics
const BearerTokenKey = 'twitterBearerToken';
function onOpen() {
SpreadsheetApp
.getUi()
.createMenu('Twitter')
.addItem('Set Bearer token', 'helpers.requestBearerToken')
.addItem('Sign out', 'helpers.logout')
.addToUi();
}
@gzxu
gzxu / README.md
Last active May 24, 2024 19:57
Run rsync server on Android Termux

Usually we will use this command

rsync --dry-run -a --mkpath --no-o --no-g --no-p -P -c SRC/ DST/

Remove --dry-run to actually copy the files rather than merely comparing

Remove -c to make it faster by comparing mod-time and size rather than checksum

@spencemal1
spencemal1 / image-to-text.gs
Created September 8, 2020 23:43
Apps Script image to text OCR
function doGet(request) {
if (request.parameters.url != undefined && request.parameters.url != "") {
var imageBlob = UrlFetchApp.fetch(request.parameters.url).getBlob();
var resource = {
title: imageBlob.getName(),
mimeType: imageBlob.getContentType()
};
var options = {
ocr: true
};
<html class="theme-light" id="content">
<head>
<title>Notes</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style>
@SpeedZ
SpeedZ / Code.gs
Last active February 15, 2023 18:51
OCR
function doGet(request) {
if (request.parameters.url != undefined && request.parameters.url != "") {
var imageBlob = UrlFetchApp.fetch(request.parameters.url).getBlob();
var resource = {
title: imageBlob.getName(),
mimeType: imageBlob.getContentType()
};
var options = {
ocr: true
};
@ratacibernetica
ratacibernetica / inbucket.sh
Last active August 13, 2024 02:03
Create a disposable email server like mailinator
#!/bin/bash
# Optional:
# add an A DNS record pointing to you server's IP address
# e.g, for mydomain.com, mail -> 127.0.0.1. Would be mail.mydomain.com
docker run -it --rm --name inbucket -p 9000:9000 -p 25:2500 -p 1100:1100 inbucket/inbucket
@brentschooley
brentschooley / yt-analytics-to-gsheet.js
Created January 20, 2020 07:13
Code to store YouTube Analytics API data in a Google Sheet (https://youtu.be/DZQWcQ2Z1Tw)
const fs = require("fs");
const readline = require("readline");
const { google } = require("googleapis");
const GoogleSpreadsheet = require('google-spreadsheet');
const { promisify } = require('util');
const scope = ["https://www.googleapis.com/auth/youtube.readonly"];
const creds = require('./client_secret.json');
const doc = new GoogleSpreadsheet(process.env.SPREADSHEET_ID);