Skip to content

Instantly share code, notes, and snippets.

View coderbyheart's full-sized avatar
🌩️
building serverless IoT solutions

Markus Tacker coderbyheart

🌩️
building serverless IoT solutions
View GitHub Profile
@coderbyheart
coderbyheart / wipe-tables.ts
Created June 1, 2026 07:51
wipe-tables.ts
/**
* Wipes all items from every DynamoDB table whose name starts with the given
* prefix.
*
* Lists all tables in the account, keeps the ones matching the prefix, and for
* each one scans every item (projecting only the key attributes) and deletes
* them in batches of 25 via `BatchWriteItem`. Tables with deletion protection
* enabled are skipped. The table itself is left in place — only its contents
* are removed.
*
@coderbyheart
coderbyheart / npm-publish-preview.ts
Last active June 3, 2026 06:33
Publish a pre-release ("dev") version to NPM.
/*
* Publish a pre-release ("dev") version to NPM.
*
* Computes the next dev version as `<next-target>-dev.<n>`, where:
* - <next-target> is the latest published stable version with either the
* patch, the minor, or the major bumped by one and lower components reset
* to 0 (e.g. `14.0.4` → `14.0.5` for a fix bump, `14.0.4` → `14.1.0` for a
* minor bump, or `14.0.4` → `15.0.0` for a major bump). The bump kind is
* controlled by the `--major` and `--fix` flags; the default is a minor
* bump.
@coderbyheart
coderbyheart / .zshrc
Last active June 12, 2025 13:57
ts alias (run TypeScript in Node.js)
alias ts='f() { node --experimental-transform-types --no-warnings $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20} };f'
@coderbyheart
coderbyheart / convert-imports.js
Last active February 10, 2025 10:11
Migrate from TSX to native Node.js TypeScript running
import fs from 'node:fs'
import path, { dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = dirname(fileURLToPath(import.meta.url))
console.log(__dirname) // Outputs: /absolute/path/to/directory
const updateImports = (directory) =>
fs.readdirSync(directory).forEach((file) => {
const filePath = path.join(directory, file)
@coderbyheart
coderbyheart / all.sh
Last active July 14, 2024 13:03
Clone all repos of a GitHub organization
curl -s https://api.github.com/orgs/bifravst/repos\?per_page\=200 | jq '.[] | select( .archived == false).clone_url' -r | xargs -I@ git clone --depth 1 @
@coderbyheart
coderbyheart / aws-iot-encode-binary.md
Created April 25, 2024 10:35
Encoding binary in AWS IoT Shadow

Meta data

{
  "myBinaryPayload": "7483c2f64e8f085b",
  "myBinaryPayload:coap-content-format": 42
}

Encode as object

@coderbyheart
coderbyheart / README.md
Last active April 8, 2024 08:37
Broken ESM Lambda when folder exists with same name as handler module

When a lambda is authored with this structure:

acme.js
acme/lib.js

and the acme.js imports from acme/lib.js it breaks:

@coderbyheart
coderbyheart / notes.txt
Created April 2, 2024 15:18
FroGSConf 23 March 2024 - How to find employers that value quality (and you)?
Who is interviewing you? Do you talk to the people you'd be working with everyday?
Does someone else you know have insider information before a formal interview?
Why do you need this role? How is this competency covered in the org at the moment?
What is the current mindset of the team?
How is a team formed? Do we all win together?
What's the salary like?
What are people's typical hours? What is it like when you get close to a deadline?
Check out Glassdoor reviews (but keep in mind it can be anecdotal)
What's difficult about the current situation?
Are you expected to be in the office, have your camera on?
@coderbyheart
coderbyheart / fetch.js
Last active March 7, 2024 11:41
Kartverket API for vasstandsdata
import { xml2json } from "xml-js";
const station = async ({ latitude, longitude }) => {
const req = `https://api.sehavniva.no/tideapi.php?${new URLSearchParams({
lat: latitude,
lon: longitude,
datatype: "obs",
refcode: "cd",
interval: 60,
dst: 0,
@coderbyheart
coderbyheart / abstract.md
Last active February 22, 2024 16:25
The Synergistic Symphony: How Blockchain and AI Will Orchestrate a Global Renaissance

The Synergistic Symphony: How Blockchain and AI Will Orchestrate a Global Renaissance

In today's increasingly interconnected and complex world, we face unprecedented challenges. From climate change and resource scarcity to social inequality and political turmoil, the very fabric of our society is being tested. In this transformative talk, we will embark on an enlightening journey to explore the revolutionary potential of a powerful synergy: the convergence of blockchain and artificial intelligence.

This deep dive will delve into the unique strengths of each technology. We will examine how blockchain's inherent transparency, immutability, and security can foster trust and accountability in critical systems, while AI's unparalleled analytical and decision-making capabilities can unlock new avenues for efficiency, optimization, and innovation. By harnessing the power of this dynamic duo, we can pave the way for a brighter future.

Join us as we explore how this synergistic symphony can be leveraged to:

  • **