Skip to content

Instantly share code, notes, and snippets.

View rudimusmaximus's full-sized avatar
🎯
Chillin!!!

raul flores jr rudimusmaximus

🎯
Chillin!!!
View GitHub Profile
@rudimusmaximus
rudimusmaximus / queryASpreadsheet.gs
Last active November 4, 2019 16:07
Follow up to Totally UnScripted Episode 3: SQL like queries in Google Apps Script
/**
* quickly test our function
*/
function test(){
var result = queryASpreadsheet('1sPevvtTMSd9LUptX8qdsw4VJf07nOal_1qn9JLwO4fQ',
'Example Data',
'A1:C',
'SELECT A,B,C WHERE B < 7');
var rows = result.length;//7
@rudimusmaximus
rudimusmaximus / Four Level NAME$PACE Example for google apps script
Last active January 21, 2018 09:56
Completed example .gs to demonstrate 4 level namespacing
/****
* 'SEED' THE NAMESPACES
*****/
var NAME$PACE1 = (function(ns) {
ns.author = "Raul Flores, Jr";
ns.description = "This is an example 4 level namespace."
ns.value = "some value";
ns.Enums = {
ZERO: 0,
ONE: 1,
@rudimusmaximus
rudimusmaximus / bookendWithToast.gs
Last active April 7, 2018 18:28
In Google Apps script (for a sheet), use "bookend toast" messages to cleanly communicate with user when script has executed first and last line
/**
* Example use of a single pair of toast messages
*/
function doSomethingExample() {
//toast(msg, title, timeoutSeconds)
SpreadsheetApp.getActive().toast("Working...", "Doing x", 30);//message 1 longer than you need
Utilities.sleep(8000); //8 seconds simulating work
SpreadsheetApp.getActive().toast("Finished!","OK", 2);//message 2 interrupts message 1
@rudimusmaximus
rudimusmaximus / a Google Apps Script Getting Started Guide.md
Last active February 11, 2020 16:51
Getting started in google apps script

How To Get Started In Google Apps Script

Initially intended to extend G Suite apps, I like to think of Google Apps Script as a gateway to more kinds of development. Think of it as workflow glue and the power of programming that can interract with Google Apps and external APIs too!

Purpose

Provide a living document for whenever someone asks, " so, how do i get started with Google Apps Script?".

Working Outline

Just the orgainizing principles and some key links.

1 Starting point: Good Things to Keep in Mind

Scripts are 'bound' to a container like sheets, docs, slides or forms. These can be accessed from the containing doc and opened say in sheets by going to the menu Tools > Script editor. Scripts can also be standalone for addons or web apps. Your script home page is a dashboard found here script.google.com. The help link there will get you to an explanation of the dashboard.

@rudimusmaximus
rudimusmaximus / explanation.md
Created April 7, 2018 18:09 — forked from masak/explanation.md
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@rudimusmaximus
rudimusmaximus / submit.md
Created April 23, 2018 19:34 — forked from tanaikech/submit.md
Benchmark: Loop for Array Processing using Google Apps Script

Benchmark: Loop for Array Processing using Google Apps Script

April 16, 2018

Kanshi Tanaike

Introduction

/**
* Takes a google maps api key and
* a json props object to generate
* a valid URL to a static map image.
* 
* @returns a valid URL to static map image
*/
function getStaticMap(key, props) {
 const markers = (props.markers || []).map(marker =&gt; 
@rudimusmaximus
rudimusmaximus / Atom4GAS.md
Last active January 20, 2019 17:26
A setup for Atom GAS projects using DevFlow - WIP

Description

Working out an atom setup for my GAS work with DevFlow and work adventures. I like to setup on macOS and on Ubuntu running in Crouton on a Chromebook in developer mode.

Requirements

In an atom project, for *.gs, *.js, and *.ts files support:

  • nested namespacing autocomplete for the project
  • nested namespacing autocomplete for GAS basic and advanced services(?)
  • nice to have hover and hyperclick features
@rudimusmaximus
rudimusmaximus / submit.md
Created October 22, 2019 10:45 — forked from tanaikech/submit.md
Retrieving Values from Filtered Sheet in Spreadsheet using Google Apps Script

Retrieving Values from Filtered Sheet in Spreadsheet using Google Apps Script

This is a sample script for retrieving values from filtered Sheet in Spreadsheet using Google Apps Script. When the values are retrieved the filtered sheet by the basic filter, if setValues() and setDisplayValues() are used, all values without the filter are retrieved. In this script, I would like to introduce the method for retrieving the values from the filtered sheet using Google Apps Script.

In order to retrieve the values from the filtered sheet, one method has already been proposed. That method retrieved the values from the filtered sheet by retrieving columnMetadata and rowMetadata of the method of spreadsheet.get of Sheets API. In this case, the rows and columns hidden by the filter can be retrieved.

In this sample script, columnMetadata and rowMetadata of the method of spreadsheet.get of Sheets API are not used. The values are directly retrieved.

Spreadsheet

@rudimusmaximus
rudimusmaximus / 60-jetbrains.conf
Created January 2, 2020 16:57 — forked from bittner/60-jetbrains.conf
Inotify configuration for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm). Create this file with e.g. `sudo vim /etc/sysctl.d/60-jetbrains.conf`
# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
# Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu), and
# run `sudo service procps start` or reboot.
# Source: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
#
# More information resources:
# -$ man inotify # manpage
# -$ man sysctl.conf # manpage
# -$ cat /proc/sys/fs/inotify/max_user_watches # print current value in use