Skip to content

Instantly share code, notes, and snippets.

View andywerner's full-sized avatar

Andy Werner andywerner

  • JobNinja
  • Munich, Germany
View GitHub Profile
@andywerner
andywerner / PushToWebEndpoint.gs
Last active February 13, 2025 09:05
PushToWebEndpoint
/**
* This Google Apps Script provides functionality to:
* 1. Query a Google Sheet via an HTTP GET request.
* 2. Push data from the sheet to an external endpoint using a menu-triggered action.
*
* Features:
* - Reads data from a specific sheet and processes specified columns.
* - Allows adding a custom menu to trigger the data push.
* - Logs progress and timing information for debugging.
*/
@andywerner
andywerner / SearchWebEndpoint.gs.gs
Last active February 13, 2025 09:00
SearchWebEndpoint
/**
* This Google Apps Script provides a web app interface for querying data from a Google Sheet.
* It enables HTTP GET requests to search for a specific value in a specified column.
* The script returns the matching row as a JSON object and includes debug information such as:
* - Time taken for search and retrieval
* - Deployment version
* - Last edited time of the sheet
*/
// Define constants for configuration
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
// IMPORTANT: Requires one row (atr least?) to be "frozen" as column headers!!!! Fails otherwise!
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
@andywerner
andywerner / font_grabber.rb
Last active November 24, 2017 13:39 — forked from ttscoff/font_grabber.rb
Give it a <link> from Google fonts or a css file downloaded from google fonts and get back CSS with fonts embedded
#!/usr/bin/ruby
# encoding: utf-8
# Grab google web fonts and embed them as base64 data URIs
# <http://brettterpstra.com/2015/03/14/embedding-google-web-fonts/>
require 'base64'
if ARGV.length > 0
input = ARGV
elsif STDIN.stat.size > 0
input = STDIN.read.strip.split(/\n+/)