Skip to content

Instantly share code, notes, and snippets.

View phromo's full-sized avatar

Martin Lindvall (phromo) phromo

View GitHub Profile
@phromo
phromo / pipewire.md
Created February 24, 2023 09:38 — forked from the-spyke/pipewire.md
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Unfortunately, aptX and AAC are not enabled because of patents and other technical reasons. However, looks like aptX will be available in coming 22.10 release. If you need these codecs in 22.04 you may use this PPA from @aglasgall which is based on universe, but rebuilds pipewire with

// showcase using RxJs observables in Vue3
import { ref, Ref, readonly, watchEffect } from 'vue'
import { Subject, Observable } from 'rxjs';
import { scan } from 'rxjs/operators';
function rxToVue<T>(observable: Observable<T>, defaultValue: T): [Ref<T>, () => void] {
const obsRef = ref(defaultValue) as Ref<T>;
const subscription = observable.subscribe({next: (v) => obsRef.value = v})
// need to return subscription so it can be cancelled in onUnmounted
@phromo
phromo / tekniskascraper.rb
Created January 26, 2012 20:37
scraping tekniska verken
require 'rubygems'
require 'celerity'
@browser = browser = Celerity::Browser.new(:resynchronize => true, :log_level => :info)
start_url = "http://www.tekniskaverken.se/mp/tvab/login.xml"
page = @browser.goto(start_url)
username = "<username>"
password = "<password>"