Skip to content

Instantly share code, notes, and snippets.

View baruchiro's full-sized avatar
:shipit:
I'm on reserve duty

Baruch Odem (Rothkoff) baruchiro

:shipit:
I'm on reserve duty
View GitHub Profile
@baruchiro
baruchiro / main.gs
Last active March 22, 2023 17:43
Google Apps Script reuse
function doPost(e) {
log("Received doPost")
try {
const { chatId, text, update } = getUpdate(e)
if (myChatId !== chatId)
return sendMessage(chatId, `You are not authorized`)
if (!isDocument(update))
return sendMessage(chatId, `message is without document`)
@baruchiro
baruchiro / cache.js
Created January 15, 2023 15:07
Very simple cache function
const _cache = {}
/** @param {string[]} keys */
const buildNewKeys = (keys) => keys.reduce((acc, currentKey) => {
if (!acc[currentKey]) {
acc[currentKey] = {}
}
return acc[currentKey]
}, _cache)
@baruchiro
baruchiro / openapi.yml
Last active March 18, 2024 18:16
An OpenAPI (Swagger) doc for the Wordpress API (api.wordpress.org)
openapi: '3.0.3'
info:
title: Wordpress API
version: '1.0'
servers:
- url: https://api.wordpress.org/
externalDocs:
description: Original documentation
url: https://codex.wordpress.org/WordPress.org_API
@baruchiro
baruchiro / .gitignore
Last active April 4, 2024 05:59
Read all Notion Database items and parse them to Whatsapp message
.env
data.json