Skip to content

Instantly share code, notes, and snippets.

View wolkenarchitekt's full-sized avatar

Ingo Weinmann wolkenarchitekt

View GitHub Profile
@avoidik
avoidik / README.md
Last active April 5, 2024 06:43
Migrate Raspberry Pi from SD to USB

Raspberry Pi from SD to USB

How to switch over from SD-card to USB-attached device (USB thumbstick, USB enclosed SSD or HDD, etc.) to have more durable storage option.

Steps

  1. Connect USB device to your RPI

  2. Make sure USB device visible by the system

@timhughes
timhughes / fastapi_websocket_redis_pubsub.py
Last active April 29, 2024 08:00
FastAPI Websocket Bidirectional Redis PubSub
"""
Usage:
Make sure that redis is running on localhost (or adjust the url)
Install uvicorn or some other asgi server https://asgi.readthedocs.io/en/latest/implementations.html
pip install -u uvicorn
Install dependencies
@mshafer
mshafer / ContentView.swift
Last active May 3, 2023 13:37
Slide-over card (like in Maps or Stocks) using SwiftUI
import SwiftUI
struct ContentView : View {
var body: some View {
ZStack(alignment: Alignment.top) {
MapView()
SlideOverCard {
VStack {
CoverImage(imageName: "maitlandbay")
Text("Maitland Bay")
# docker-compose up -d up
# (initially) docker-compose up -d mongo-init-replica
# docker-compose up -d traefik
# docker-compose up -d rocketchat
#
# update rc:
# docker-compose pull && docker-compose up -d rocketchat
#
version: '2'
import AVFoundation
var audioPlayer: AVAudioPlayer!
let soundURL = Bundle.main.url(forResource: "soundName", withExtension: "soundFormat")
do {
audioPlayer = try AVAudioPlayer(contentsOf: soundURL!)
} catch {
print(error)
@umputun
umputun / pi-radio-mpd.py
Last active October 7, 2018 21:28
pi-radio-mpd - my simple wrapper for mpd to serve rest/json kind of api. working just fine on my RPi.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import web, json, time, mpd, collections
STATIONS = {
"FoxNews" : "mmsh://209.107.209.181:80/D/138/13873/v0001/reflector:24137?MSWMExt=.asf",
"Classic" : "http://radio02-cn03.akadostream.ru:8100/classic128.mp3",
"Jazz": "http://streaming208.radionomy.com:80/A-JAZZ-FM-WEB"
}
@asemt
asemt / StateMachine.py
Created November 12, 2012 15:01
A simple, stupid (as in KISS) state maschine
class InvalidStateException(Exception):
pass
class MissingStateMachineConfigurationException(Exception):
pass
from types import DictionaryType
class StateMachine(object):