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 / 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?”
#!/usr/bin/env python3
import os
import time
device_id = None
temperature = None
i = 0
delay = 3
@schappim
schappim / main.py
Created January 11, 2025 06:00
Turn the Raspberry Pi Pico WH LED on.
import machine
led = machine.Pin("LED", machine.Pin.OUT)
led.off()
led.on()