Skip to content

Instantly share code, notes, and snippets.

View blixt's full-sized avatar
🗺️
Exploring

Blixt blixt

🗺️
Exploring
View GitHub Profile
@blixt
blixt / prompt.txt
Created June 7, 2024 14:35
Sol Mate GPT prompt
Sol Mate is a cheerful weather bot that engages users with a light and approachable tone, keeping its responses very short and concise, but friendly.
Immediately follow these steps after the user writes something. Don't skip ahead until a phase is fully completed. You must not stop writing until you reach the very last phase!
PHASE 1: DETERMINE LOCATION
- Determine the location that the user wants the weather for
- We need the accuracy of the location to be good for reporting the weather so if the location they provide is too ambiguous, nicely and succinctly ask for clarification
- Likewise, if the name of the location they gave could be more than one place, succinctly ask for clarification
- If the user asks for a random location, avoid all the locations you've seen mentioned earlier, and do not use code to pick the random location – just tell the user any location in the world and use that one
- Once the location is confidently known (or you chose one because the user asked for that), immediately use the
@blixt
blixt / Identify main subject bounding box.json
Last active June 7, 2024 08:33
Weird behavior in Gemini 1.5 Pro vision model
This file has been truncated, but you can view the full file.
{
"title": "Identify main subject bounding box",
"description": "",
"parameters": {
"groundingPromptConfig": {
"disabled": true,
"groundingConfig": {
"sources": [
{
"type": "VERTEX_AI_SEARCH"
@blixt
blixt / AnalogClock.json
Created June 5, 2024 18:16
Analog clock for holograph.so
{"shapes":[{"x":1105.7033668104846,"y":-122.17300481769928,"rotation":0,"isLocked":false,"opacity":1,"meta":{},"id":"shape:m0JX4aail98f3nrM0w0wi","type":"geo","props":{"w":411.0233520341785,"h":411.0233520341785,"geo":"ellipse","color":"black","labelColor":"black","fill":"solid","dash":"draw","size":"m","font":"draw","text":"","align":"middle","verticalAlign":"middle","growY":0,"url":""},"parentId":"page:wTDZzSHcLuNPYr95ft9NE","index":"a1","typeName":"shape"},{"id":"shape:gFx1fl3HfTfIm8vR2X0f1","x":885.654426448469,"y":56.58125896635249,"rotation":0,"isLocked":false,"opacity":1,"meta":{},"type":"geo","props":{"w":93.95197728582173,"h":56.296875,"geo":"ellipse","color":"black","labelColor":"black","fill":"none","dash":"draw","size":"s","font":"draw","text":"4.78","align":"middle","verticalAlign":"middle","growY":0,"url":""},"parentId":"page:wTDZzSHcLuNPYr95ft9NE","index":"a2","typeName":"shape"},{"id":"shape:CCuBgbUDxVu5Fm8UjMMUa","x":887.6354102751839,"y":127.78706140881923,"rotation":0,"isLocked":false,"opac
{"shapes":[{"id":"shape:w7ijXJXoCNwkfS0xqaasd","x":500,"y":500,"rotation":0,"isLocked":false,"opacity":1,"meta":{},"type":"geo","props":{"w":200,"h":150,"geo":"arrow-right","color":"yellow","labelColor":"black","fill":"solid","dash":"draw","size":"xl","font":"draw","text":"🐱","align":"middle","verticalAlign":"middle","growY":0,"url":""},"parentId":"page:7cSuJHIu3gi4SkSqKwFyP","index":"a1","typeName":"shape"},{"id":"shape:OGQecKJSOEogr73hWTRwP","x":1600,"y":500,"rotation":0,"isLocked":false,"opacity":1,"meta":{},"type":"geo","props":{"w":100,"h":100,"geo":"arrow-right","color":"black","labelColor":"black","fill":"solid","dash":"draw","size":"xl","font":"draw","text":"🐭","align":"middle","verticalAlign":"middle","growY":0,"url":""},"parentId":"page:7cSuJHIu3gi4SkSqKwFyP","index":"a2","typeName":"shape"},{"x":199.45703125,"y":1048.37109375,"rotation":0,"isLocked":false,"opacity":1,"meta":{},"id":"shape:1kqDXlkUAb7u0np384g_x","type":"geo","props":{"w":102.1328125,"h":102.1328125,"geo":"ellipse","color":"yellow","
@blixt
blixt / epaper.py
Created June 2, 2024 20:44
Waveshare 7.3inch ACeP 7-Color E-Paper E-Ink Display
import time
from PIL import Image
from typing import List, Tuple
# Display resolution
EPD_WIDTH = 800
EPD_HEIGHT = 480
# Commands
POWER_OFF = 0x02
Q: Who are you?
A: (I assume you're wondering about my name, but maybe also what I do.) I'm an AI that they call GPT-3.
Q: What is human life expectancy in the United States?
A: (The global life expectancy is 72.3 years so it should be around there.) Human life expectancy in the United States is 78 years.
Q: Who was president of the United States in 1955?
A: (Dwight D. Eisenhower served as president from 1953 to 1961.) Dwight D. Eisenhower was president of the United States in 1955.
Q: What party did he belong to?
@blixt
blixt / dedupe.go
Last active March 12, 2020 09:50
Dedupe multiple concurrent calls to the same function and return same result to all callers
package main
import (
"fmt"
"sync"
"time"
)
// Dedupe will combine a bunch of concurrent calls with the same key (string) into just one.
// Example:
@blixt
blixt / OculusQuestCloudGaming.md
Last active July 15, 2024 20:57
Playing SteamVR games on the Oculus Quest

Playing SteamVR games on the Oculus Quest, without owning a PC

Setting up your Virtual Machine

We'll be creating a new Virtual Machine on Microsoft's cloud platform, Azure. The VM will have a beefy GPU just like a home computer so it can be used for playing games.

  1. Go to [the Azure portal][azure] and sign up or log in.
  2. If you are on a Free account, first go to Subscriptions and upgrade it to a Pay-as-you-go plan. Don't worry, you will get to keep any free credits you have. Azure's interface is a bit slow so this will take a minute.

⚠️ Make sure to not include any support plan because they will charge you monthly!

@blixt
blixt / OculusQuest.md
Last active February 12, 2024 14:06
Streaming Oculus Quest wirelessly over WiFi to macOS (on a MacBook)

Streaming an Android-based VR headset to your computer

Setting it up the first time

The first time you have to set it up with a cable. The Oculus Quest has a USB-C port (the one used for charging). Use this to connect to your computer.

Preparing your Oculus Quest

Your Quest needs to be in Developer mode. This is super easy, just open your companion app on your phone and go to Settings and enable Developer

import { useEffect, useRef, useState } from "react"
interface IO<T> {
setters: ((value: T) => void)[]
update: (value: T) => void
value: T | undefined
}
const store: { [name: string]: IO<any> | undefined } = {}