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?"
# 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 / .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
@io41
io41 / paginated_collection.js
Created February 22, 2011 10:10 — forked from zerowidth/paginated_collection.js
Pagination with Backbone.js
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
@io41
io41 / maildirtocouch.py
Created December 21, 2011 23:28 — forked from faried/maildirtocouch.py
Store messages in a Maildir into a couchdb database.
#!/usr/bin/env python
"""Store messages in a Maildir into a couchdb database."""
import couchdb
from mailbox import Maildir
from optparse import OptionParser
import os
from pprint import pprint
import sys
from uuid import uuid4
@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 / tts.fish
Created September 19, 2013 15:25 — forked from anonymous/tts.fish
function tts
set q $argv;
mplayer "http://translate.google.com/translate_tts?ie=UTF-8&q=$q&tl=en&textlen="(math (echo "$q" | wc -m) - 1)"idx=0&total=1&prev=input";
end