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 / .gitignore
Last active April 4, 2024 05:59
Read all Notion Database items and parse them to Whatsapp message
.env
data.json
@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 / 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 / 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`)

Release

I'm using semantic-release to perform releases and changelog.

The convention is the eslint format, with the next rules:

{tag: 'Breaking', release: 'major'},
{tag: 'Fix', release: 'patch'},
{tag: 'Update', release: 'minor'},
@baruchiro
baruchiro / WindowsTerminal_settings.json
Last active February 21, 2021 14:46
Windows Terminal profile
// This file was initially generated by Windows Terminal 1.5.10411.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// You can add more global application settings here.
@baruchiro
baruchiro / Microsoft.PowerShell_profile.ps1
Created February 20, 2021 19:44
My Powershell Profile
# Gist: https://gist.github.com/baruchiro/e204078b67d96c16d8ee9bf523206c31
Set-PoshPrompt -Theme ~/.mytheme.omp.json
# git push master && git switch dev -> g p sm
function ParseAliases {
foreach ($command in $args) {
Write-Host "> git $command" -ForegroundColor Green
Invoke-Expression -Command "git $command"
}
@baruchiro
baruchiro / .mytheme.omp.json
Last active July 11, 2021 08:55
My oh-my-posh profile
{
"Gist": "https://gist.github.com/baruchiro/22d931516479981565c79278c04ba9a9",
"final_space": false,
"osc99": false,
"console_title": false,
"console_title_style": "",
"console_title_template": "",
"blocks": [
{
"type": "prompt",
@baruchiro
baruchiro / .gitconfig
Last active March 10, 2021 08:35
My git configurations and aliases
# This is Git's per-user configuration file.
# Gist: https://gist.github.com/baruchiro/95d5e0a3e4dde5d2642bbfb72d520a67
[user]
email = baruchiro@gmail.com
name = Baruch Odem
[credential]
helper = manager
[includeIf "gitdir:C:/Checkmarx/"]
path = C:/Checkmarx/.gitconfig
[alias]
@baruchiro
baruchiro / Dockerfile
Last active February 19, 2021 09:34
Dockerfile for auto update MongoDB from JSON file
FROM mongo
ARG REPO_USER=baruchiro
ARG REPOSITORY=Accounts
ARG RESTORE_SCRIPT=mongo/load.sh
ENV REPOSITORY=${REPOSITORY}
ENV RESTORE_SCRIPT=${RESTORE_SCRIPT}
RUN apt-get update