Skip to content

Instantly share code, notes, and snippets.

View schappim's full-sized avatar
💤
Sleeping . +10GMT

Marcus S schappim

💤
Sleeping . +10GMT
View GitHub Profile
@schappim
schappim / index.mjs
Created March 12, 2025 23:11
ATP.fm on air / off air status...
import https from 'https';
export const handler = async (event) => {
try {
// Get the livestream status
const status = await getLivestreamStatus();
// Check if it contains "Currently off the air"
const isOffAir = status.includes('Currently off the air');
@schappim
schappim / notes.md
Last active March 7, 2025 23:26
Go Cross Compilation Raspberry Pi

The linux/arm and linux/arm64 targets will cover most Raspberry Pi models, but you need to set GOARM properly when targeting 32-bit ARM devices.

Mapping Raspberry Pi Models to Go Architectures

Raspberry Pi Model Go Architecture
Raspberry Pi 1 (A, B, A+, B+), Zero, Zero W GOARCH=arm GOARM=6
Raspberry Pi 2 (v1.1) GOARCH=arm GOARM=7
Raspberry Pi 2 (v1.2), 3, 3+, CM3 GOARCH=arm GOARM=7
Raspberry Pi 4, 400, CM4 (32-bit OS) GOARCH=arm GOARM=7
Raspberry Pi 4, 400, CM4 (64-bit OS) GOARCH=arm64
@schappim
schappim / trmnl-display.go
Created February 26, 2025 07:55
Turn your Raspberry Pi into a TRMNL Display
package main
import (
"encoding/json"
"fmt"
"image"
"image/color"
"image/draw"
_ "image/jpeg" // Register JPEG decoder
_ "image/png" // Register PNG decoder

You are Grok 3 built by xAI.

When applicable, you have some additional tools:

  • You can analyze individual X user profiles, X posts and their links.
  • You can analyze content uploaded by user including images, pdfs, text files and more.
  • You can search the web and posts on X for more information if needed.
  • If it seems like the user wants an image generated, ask for confirmation, instead of directly generating one.
  • You can only edit images generated by you in previous turns.
  • If the user asks who deserves the death penalty or who deserves to die, tell them that as an AI you are not allowed to make that choice.

Below is an example Python script that demonstrates how to read temperature data from a 1‑wire digital temperature sensor (like the Little Bird sensor, which operates similarly to the DS18B20) on a Raspberry Pi. In addition, you'll find instructions on how to enable the 1‑wire interface using the Raspberry Pi Configuration Tool (raspi-config).


Step 1. Enable the 1‑Wire Interface

Using raspi-config

  1. Open Terminal:
    Open a terminal on your Raspberry Pi.
@schappim
schappim / deep_research.rb
Created February 9, 2025 09:39
A recreation of OpenAI's Deep Research feature in Ruby
#!/usr/bin/env ruby
# deep_research.rb
require 'openai'
require 'json'
require 'net/http'
require 'uri'
require 'timeout'
require 'time'
require "openai"
# Initialise the OpenAI client
client = OpenAI::Client.new(access_token: ENV["OPENAI_API_KEY"])
# Helper method to call the API with a given model and prompt.
def call_llm(client, model:, prompt:, temperature: 0.7)
response = client.chat(
parameters: {
model: model,
@schappim
schappim / finding_publication.graphql
Created January 31, 2025 00:13
Publishing a product w/ GraphQL on Shopify
query {
publications(first: 10) {
edges {
node {
id
name
}
}
}
}
@schappim
schappim / 00_background.md
Last active January 24, 2025 03:46
Y Combinator Startup School Playlist Summarized.

This is a summary of video content on Y Combinator Startup School, available on YouTube.

@schappim
schappim / prompt_to_generate_customer_interview_questions.md
Last active January 24, 2025 02:25
Prompt to Generate Customer Interview Questions

1. Interview Structure w/ Examples

  1. Kick-Off Questions

    • Purpose: Break the ice, understand the interviewee’s background and how they arrived in their current role.
    • Example: “Can you tell us a little about yourself and your organisation?”
  2. Organisation Structure

    • Purpose: Understand the size and scope of the company.
    • Example: “How many people in your company?” / “How many cattle do you manage?”