Skip to content

Instantly share code, notes, and snippets.

View schappim's full-sized avatar
🎯
Focusing

Marcus Schappi schappim

🎯
Focusing
View GitHub Profile
@schappim
schappim / The Ultimate Guide to High-Performance Sales and Startup Growth.md
Created January 5, 2025 22:51
The Ultimate Guide to High-Performance Sales and Startup Growth - This guide consolidates all hints, tips, statistics, and rules of thumb into a single coherent roadmap. It covers sales best practices, mindset, marketing fundamentals, operational strategies, and more—without repeating the same points multiple times. All spelling follows en-AU co…

These are my notes from Alex Hormozi's videos (in the form of a quick guide).


The Ultimate Guide to High-Performance Sales and Startup Growth

This guide consolidates all hints, tips, statistics, and rules of thumb into a single coherent roadmap. It covers sales best practices, mindset, marketing fundamentals, operational strategies, and more—without repeating the same points multiple times. All spelling follows en-AU conventions.


Table of Contents

@schappim
schappim / profile.zsh
Created January 4, 2025 01:38
Quickly edit & reload your Zsh config with this handy function! 🛠️ Open your ~/.zshrc in your editor, save, and apply changes instantly. ✨
function profile() {
/usr/local/bin/zed -w ~/.zshrc
if [[ $? -eq 0 ]]; then
echo 'Sourcing ~/.zshrc...'
source ~/.zshrc
echo '~/.zshrc updated and sourced successfully!'
else
echo 'Failed to edit ~/.zshrc.'
fi
}
@schappim
schappim / summarize_youtube.rb
Created January 3, 2025 00:57
A ruby script to summarize YouTube videos
#!/usr/bin/env ruby
# frozen_string_literal: true
# This script downloads the English auto-generated subtitles for a YouTube video,
# converts them to a single text block, and sends them to OpenAI for summarization.
# Requirements:
# - yt-dlp (brew install yt-dlp)
# - OpenAI Ruby gem (gem install 'ruby-openai')
# - An OpenAI API key set as an environment variable (export OPENAI_API_KEY=your-api-key)
@schappim
schappim / _webrtc.html.erb
Created December 18, 2024 02:31
OpenAI’s Real-time API (with WebRTC) using StimulusJS and Rails
<%# A partial that can be placed anywhere to utilise the Real-time API (with WebRTC) %>
<div data-controller="webrtc" class="bg-gray-600 rounded-full text-white mb-4 ">
<audio data-webrtc-target="audio"></audio>
<button data-webrtc-target="toggle" data-action="click->webrtc#toggleAudio" class="relative flex items-center justify-center w-full font-medium min-w-[150px] min-h-[40px]">
<div class="w-full text-center" data-button-text>Enable Audio Chat</div>
<div data-webrtc-target="spinner" class="hidden absolute">
<svg class="animate-spin h-5 w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
@schappim
schappim / query_log_analyser.sh
Created December 10, 2024 04:01
Pi-hole Query Log Analyzer
#!/bin/bash
DEFAULT_PIHOLE_IP="localhost"
DEFAULT_LIMIT=10
show_help() {
echo "Usage: $0 [-i ip_address] [-t token] [-n number] [-c client] [-d domain]"
echo " -i: IP address of Pi-hole server (default: localhost)"
echo " -t: API token (required)"
echo " -n: Number of queries to show (default: 10)"
@schappim
schappim / remote_pihole_blocklist_management.sh
Created December 10, 2024 04:00
Pi-hole Blocklist Management Script
#!/bin/bash
DEFAULT_PIHOLE_IP="localhost"
show_help() {
echo "Usage: $0 [-i ip_address] [-t token] [-a domain|-r domain|-l]"
echo " -i: IP address of Pi-hole server (default: localhost)"
echo " -t: API token (required)"
echo " -a: Add domain to blocklist"
echo " -r: Remove domain from blocklist"
#!/bin/bash
# Default values
DEFAULT_DURATION=300 # 5 minutes in seconds
DEFAULT_PIHOLE_IP="localhost"
# Help function
show_help() {
echo "Usage: $0 [-d duration] [-i ip_address] [-t token]"
echo " -d: Duration in seconds to disable Pi-hole (default: 300 seconds)"

Measuring Raspberry Pi SoC Temperature

1. Using the vcgencmd Command

Run the following command in the terminal:

vcgencmd measure_temp
import tensorflow as tf
from tensorflow.keras.applications import MobileNetV2
from tensorflow.keras.layers import Dense, GlobalAveragePooling2D, Dropout, BatchNormalization
from tensorflow.keras.models import Model
import tensorflow_datasets as tfds
import matplotlib.pyplot as plt
import numpy as np
# Constants
BATCH_SIZE = 24

How to Enable Load Balancer Health Checks in Hatchbox

A load balancer health check with Caddy ensures that backend servers are functioning properly by periodically sending requests and removing unresponsive servers from the pool.

To enable health checks, your application must have a relative path that returns a 200 status code.

Steps to enable health checks:

  1. Go to https://app.hatchbox.io/apps
  2. Click the "View" button for your application