Skip to content

Instantly share code, notes, and snippets.

@fatihkaan22
fatihkaan22 / hashcode-2022.py
Created February 24, 2022 20:58
2022 Google Hash Code
f = open("a_an_example.in.txt", "r")
cont_count, project_count = map(int, f.readline().split())
people = {}
skills = {}
for i in range(cont_count):
person, spec_count = f.readline().split()
spec_count = int(spec_count.replace("\n", ""))
people[person] = []
for j in range(spec_count):
@fatihkaan22
fatihkaan22 / headphone.py
Last active July 17, 2021 06:26 — forked from Monsterovich/headphone.py
Pipewire headphone jack fix - also switch input source
#!/usr/bin/env python
import os
import sys
from subprocess import Popen, PIPE, STDOUT
import time
HEADPHONE_EVENT = "jack/headphone"
p = Popen(["/usr/bin/acpi_listen"],
stdout=PIPE, stderr=STDOUT, bufsize=1)
@fatihkaan22
fatihkaan22 / spotify-kill-pulse-client.sh
Last active December 16, 2023 05:36
Kills unused spotify pulseaudio instances
#! /bin/bash
spotifyInstances=()
while read LINE1; read LINE2; do
IFS=':-='
read -ra L1 <<< $LINE1
read -ra L2 <<< $LINE2
# See man `man zathurarc'
# Open document in fit-width mode by default
set adjust-open "best-fit"
# One page per row by default
set pages-per-row 1
#stop at page boundries
set scroll-page-aware "true"