Skip to content

Instantly share code, notes, and snippets.

View ice09's full-sized avatar

Alexander C. ice09

View GitHub Profile
@ice09
ice09 / TalkToEmbeddedButerin.java
Last active October 25, 2023 08:08
Downloads three posts of Vitaliks blog and creates embeddings with langchain4j which can then be queried with OpenAI GPT (see https://hackmd.io/@alculexum/embedding4j)
//DEPS dev.langchain4j:langchain4j:0.23.0
//DEPS dev.langchain4j:langchain4j-open-ai:0.23.0
//DEPS dev.langchain4j:langchain4j-embeddings-all-minilm-l6-v2:0.23.0
//DEPS commons-io:commons-io:2.14.0
//DEPS org.apache.commons:commons-text:1.10.0
//DEPS org.jsoup:jsoup:1.16.1
//DEPS org.slf4j:slf4j-simple:2.0.9
package dev.indus340;
@ice09
ice09 / main.py
Created January 31, 2024 06:22
Ampelgehampel in Micropython for Raspberry Pico
# Transfer with Thonny
from machine import Pin, Timer
import utime
# Initialize LEDs
led1_r = Pin(2, Pin.OUT)
led1_y = Pin(3, Pin.OUT)
led1_g = Pin(4, Pin.OUT)
led2_r = Pin(6, Pin.OUT)
led2_y = Pin(7, Pin.OUT)
@ice09
ice09 / icon_builder.py
Last active February 5, 2024 12:49
Python script for MCPI to create a 2 dimensional 8 color blocks based on a Python array.
import sys
import mcpi.block as block
from mcpi.minecraft import Minecraft
from math import *
# Data structure representing icon as a 2D grid
# Copy the generated array from the BlockCraft chat
image = [[7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7],
[7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7],
[7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7],