Skip to content

Instantly share code, notes, and snippets.

@io41
io41 / rosie.sh
Last active January 31, 2024 22:01
Eine hilfreiche wertschätzende KI
#!/bin/bash
#set -F
VOICE=shimmer
AI_NAME=Rosie
RESPONSE_FILE=~/.ai.${AI_NAME}.response
ospeak -v $VOICE "Wie heist du?" > /dev/null 2>&1
read -p "$AI_NAME: Wie heist du? " NAME
ospeak -v $VOICE "Hallo $NAME, ich bin $AI_NAME. Was brauchst du?" > /dev/null 2>&1
echo "$AI_NAME: Hallo $NAME, ich bin $AI_NAME. Was brauchst du?"
TODAY=$(date)
@io41
io41 / wanda.sh
Last active January 31, 2024 22:01
A more enjoyable AI experience when giving support. Be Patient, it takes a little bit of time to respond. Turn your volume up.
#!/bin/bash
# Install ospeak: https://github.com/simonw/ospeak
# Install llm: https://github.com/simonw/llm
# Set your OpenAI key: export OPENAI_API_KEY="..."
ospeak -v nova "What's your name?"
read -p "Wanda: What's your name? " NAME
ospeak -v nova "Hi $NAME, I'm Wanda. What's up?"
@io41
io41 / .rgr.zsh
Last active July 4, 2023 12:47
ripgrep (rg) replace all files inplace, just like sed -i
# install ripgrep & moreutils (for the sponge tool) See https://www.putorius.net/moreutils.html
# On mac: brew install moreutils ripgrep
# Source this file in your zsh config by adding `source .rgr.zsh` to your .zshrc
function rgr() {
local context_lines=2
local search="$1"
local replace="$2"
shift 2
@io41
io41 / code.py
Created June 20, 2023 20:34
Circuit Python Example ST7735 LCD backlight fading
import board
import time
import pwmio
print("Hello world!")
class LCD:
_led = None
_led_max = 65535
@property
# dvorak layout
loadkeys dvorak
export HOSTNAME=thinkpad
export DEVICE=/dev/sda
export EFI_PARTITION=/dev/sda1
export ROOT_PARTITION=/dev/sda2
# as root
timedatectl set-ntp true
@io41
io41 / keybase.md
Last active October 24, 2018 14:57

Keybase proof

I hereby claim:

To claim this, I am signing this object:

Secret Santa

Title Header

h1.title {
  color: red;
  text-shadow: 2px 2px #A00;
}
bind @browser
@io41
io41 / Makefile
Last active August 29, 2015 14:22 — forked from kwlzn/Makefile
PYTHON := python2.6
BUILD_DIR := buildtmp
AURORA_CLUSTER := test
AURORA_ROLE := $(shell whoami)
UWSGI_VER = 2.0.4
UWSGI_DIR = uwsgi-$(UWSGI_VER)
UWSGI_FILE = $(UWSGI_DIR).tar.gz
UWSGI_URL = http://projects.unbit.it/downloads/$(UWSGI_FILE)
/**
* computes the what elements were added to, and removed from, s1
* to obtain s2, where s1 and s2 are assumed to be unordered Array
* possibly with duplicates
* uDiff([1,3], [2,3]) --> {added: [2], removed: [1]}
* uDiff([1,2,3], [2,3,1]) --> {added: [], removed: []}
* uDiff([1,2,1], [1,2,2]) --> {added: [2], removed: [1]}
* @param s1 Array
* @param s2 Array
history={'data': [
{
'o': 0, /* offset */
'h': 1, /* horizontal slide index */
'v': 0, /* vertical slide index */
},
{
'o': 120,
'h': 2,
'v': 0,