Skip to content

Instantly share code, notes, and snippets.

View pkcpkc's full-sized avatar

Paul Hackenberger pkcpkc

View GitHub Profile
@pkcpkc
pkcpkc / convert_amv.sh
Created May 3, 2025 16:45
Converts video files in current folder to AMV 128x128 compatible with RUIZU Digital Music Player. Prerequisite: ffmpeg
#!/bin/bash
# Converts video files to 128x128 amv video for RUIZU Digital Music Player
# Requires ffmpeg: brew install ffmpeg
# Supported video formats
extensions=("mp4" "mov" "avi" "mkv" "flv" "wmv" "mpeg" "mpg" "webm" "divx")
for ext in "${extensions[@]}"; do
for file in *."$ext"; do
@pkcpkc
pkcpkc / gist:1cd63f183ade17d410b13bb4294adeb5
Last active February 15, 2025 18:28
Chain of AI Tools from analysis, to summary, podcast and presentation
Stanford Co-STORM
├── ChatGPT
├── Gemini
├── Perplexity
└── NotebookLM
└── Summary
├── Audio Podcast
└── ChatGPT
└── Visual Basic Code
└── PowerPoint
@pkcpkc
pkcpkc / 15-most-important-app-kpis.txt
Created October 29, 2024 16:35
15 most important app KPIs
Mobile App KPI Categories
├── UX & Performance Metrics
│ ├── Load Speed
│ ├── Device & OS Tracking
│ ├── Screen Resolution
│ └── Crash Reports
├── Engagement Metrics
│ ├── Session Length & Depth
│ ├── Screens per Visit
│ ├── Active Users (DAU, WAU, MAU)
@pkcpkc
pkcpkc / 50-mobile-app-kpis.txt
Last active October 29, 2024 16:35
50 Mobile App KPIs
Mobile App KPIs
├── General Mobile App KPIs
│ ├── User Growth Rate
│ ├── Mobile Downloads
│ ├── Retention Rate
│ ├── Install Trend
│ ├── Uninstall Trend
│ ├── Registrations
│ ├── Subscriptions
│ ├── Crashes
@pkcpkc
pkcpkc / index.js
Last active February 12, 2024 09:59
decode-ios-receipt
// see https://www.npmjs.com/package/node-apple-receipt-verify#configoptions-object
// https://medium.com/axel-springer-tech/debugging-and-reading-apple-receipts-2e47f9793f74
const params = {
"-p": {
"name": "environment",
"default": ['sandbox'],
"set": ['production']
},
"-ie": {
"name": "ignoreExpired",
@pkcpkc
pkcpkc / disjunct.js
Created October 24, 2023 07:31
Split in disjunct sub-requests
Array.prototype.intersection = function (otherArray) {
return this.filter(element => otherArray.includes(element));
};
Array.prototype.subArray = function (start, end) {
return this.filter(function (element, index) { return index >= start && index < end });
}
Array.prototype.includesAny = function (otherArray) {
return this.intersection(otherArray).length > 0;
@pkcpkc
pkcpkc / tech-radar.html
Last active May 7, 2021 10:22
JavaScript: Tech Radar based on Zalandos code https://opensource.zalando.com/tech-radar/
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Tech Radar</title>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://opensource.zalando.com/tech-radar/release/radar-0.5.js"></script>
</head>
<body>
@pkcpkc
pkcpkc / inline-images.sh
Last active August 9, 2019 19:06
Replace all local images references in HTML with base64 inline data, e.g. for HTML emails
#!/bin/bash
# Searches for <img src="localImage" alt="altText"/> in index.html and replaces with:
# <img src="data:image/png;base64,..." alt="altText"/>
# writes output to build/index.html
mkdir -p build
# awk is really awkward: does not accept regexp groups :(
# I'll keep the () anyways for my mental health!
@pkcpkc
pkcpkc / index.html
Last active March 29, 2019 17:43
HTML/UML: Default setup for mermaidJS https://mermaidjs.github.io/
<html>
<head>
<!-- https://mermaidjs.github.io/sequenceDiagram.html -->
<script>
function generateTableOfContents(maxHeaderLevel = 3, styleItem = function (text, level, itemAnchor) {
var spaces = "&nbsp;".repeat(Math.max(0, (level - 1)) * 3);
var tocEntry = spaces + '• <a href="#' + itemAnchor + '">' + text + '</a><br/>';
return tocEntry;
}) {
@pkcpkc
pkcpkc / tableOfContents.js
Last active December 22, 2023 20:27
JavaScript: HTML heading Table of Contents: Generate a navigatable, stylable table of contents based on the heading structure of an html document
/*
Collect headers (h1, h2, ..., hx) from html and generates navigatable, stylable table of contents.
@param maxHeaderLevel int Define header level depth, defaults to 3.
@param styleItem function Function that accepts text:string, level:int and itemAnchor:string to style toc entry, default renderer is set already (check source for usage).
@return string HTML table of contents
*/
function generateTableOfContents(maxHeaderLevel = 3, styleItem = function (text, level, itemAnchor) {
var spaces = "&nbsp;".repeat(Math.max(0, (level - 1)) * 3);
var tocEntry = spaces + '<a href="#' + itemAnchor + '">' + text + '</a><br/>';