Skip to content

Instantly share code, notes, and snippets.

View Jaballadares's full-sized avatar

John Balladares Jaballadares

View GitHub Profile
/** * @OnlyCurrentDoc */
function moveColumns() {
// get sheet
var sheet = SpreadsheetApp.getActiveSheet();
// select columns to be moved ('collegename' & 'shoesize')
var columnsToMove = sheet.getRange("E1:F1");
@evanreichard
evanreichard / archive-redirect.user.js
Last active September 15, 2023 07:40
Auto Archive Redirect
// ==UserScript==
// @name Auto Archive Redirect
// @namespace Evan Reichard
// @version 0.0.3
// @match *://*/*
// @grant GM.xmlhttpRequest
// @grant GM.openInTab
// @noframes
// @run-at document-start
// ==/UserScript==
@paulirish
paulirish / Code.gs
Created March 4, 2022 21:33
finding most common senders in gmail - apps script
// this is pretty quick and rough.. but it works
// script.google.com
// settings to allow editing the appscript.json
// set these two files
// then hit Run with function 'run'
const all = {};
function run() {
@kepano
kepano / obsidian-web-clipper.js
Last active April 28, 2025 07:22
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@wcarss
wcarss / order-by.js
Last active May 13, 2021 15:50
a toy function to sort js arrays with sql-like syntax
// preamble: public domain; no warranty
//
// this is a toy -- it is slow, cannot handle unicode, keys w/
// spaces, nested keys, natural ordering, etc.
// orderBy('key1 [asc|1|desc|-1][, key2 [asc|1|desc|-1]][, etc]')
//
// write sql-like sort orders for arrays of objects, e.g.:
//
async function onTrack(event, settings) {
if (event.event !== settings.eventName) {
return;
}
const product = event.properties.products[0];
const itemPurchased = `${product.brand} ${product.name}`;
const Body = `Thank you for purchasing ${itemPurchased} from our site. We will follow-up with the tracking details shortly.`;
const To = settings.twilioDestinationNumber;
@rezonn
rezonn / GASPolyfills.js
Last active January 28, 2021 04:49
Google Apps Script polyfills
function fetch(url,options2) {
if (options2) {
if (options2.body) {
options2.payload = options2.body.toString("binary");
options2.body = undefined;
}
}
return new Promise(function (resolve, reject) {
try {
var data = UrlFetchApp.fetch(url, options2);
@spencerwooo
spencerwooo / termiWidget.js
Last active September 22, 2024 21:46
🍋 TermiWidget - Terminal-like Widget for iOS 14, made with Scriptable.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: orange; icon-glyph: quote-right;
// Change these to your usernames!
const user = "spencer"
const jike = "4DDA0425-FB41-4188-89E4-952CA15E3C5E"
const telegram = "realSpencerWoo"
const github = "spencerwooo"
@kopischke
kopischke / Functions.js
Last active September 1, 2024 00:16
Code snippets for Script actions in Airtable Automations
// Utility functions for Airtable Automations
/**
* @param {string} url
* @param {Base} [forBase=base]
*/
function getTableFromURL(url, forBase) {
let root = forBase ? forBase : base
let found = url.match(/^https?:\/\/airtable.com\/(?<tableID>[^\/]+)/)
return root.getTable(found.groups.tableID)
@ex-preman
ex-preman / Code.gs
Last active April 17, 2025 02:09
CRUD Using Google Apps Script
function doGet(e) {
Logger.log(e);
var op = e.parameter.action;
var ss = SpreadsheetApp.open(DriveApp.getFileById("YOUR_SPREADSHEET_ID"));
var sn = "YOUR_SHEET_NAME";
var sheet = ss.getSheetByName(sn);
if (op == "insert")
return insert_value(e, sheet);