Skip to content

Instantly share code, notes, and snippets.

View mnn's full-sized avatar

monnef mnn

View GitHub Profile
@mnn
mnn / pa-app-sink-switcher.py
Created December 24, 2022 08:57 — forked from Programie/pa-app-sink-switcher.py
Toggle PulseAudio output sink for the active application
#! /usr/bin/env python3
# This script toggles the PulseAudio output sink of the currently active application (guessed by the currently active X window) between the given output sink and the default output sink.
# The output sink is passed as first argument to the script.
#
# Requirements:
#
# xdotool (on Ubuntu install via "sudo apt install xdotool")
# pulsectl ("sudo pip3 install pulsectl")
@mnn
mnn / Deserialization.scala
Created June 29, 2016 18:19 — forked from ramn/Deserialization.scala
Object serialization example in Scala
import java.io._
@SerialVersionUID(15L)
class Animal(name: String, age: Int) extends Serializable {
override def toString = s"Animal($name, $age)"
}
case class Person(name: String)
// or fork := true in sbt
import groovy.transform.CompileStatic
@CompileStatic
void swap(int[] a, int i, int j) {
int temp = a[i]
a[i] = a[j]
a[j] = temp
}
@CompileStatic