Skip to content

Instantly share code, notes, and snippets.

View serpro69's full-sized avatar
🍵
breaking things when they work, so I can fix them later

Særgeir serpro69

🍵
breaking things when they work, so I can fix them later
View GitHub Profile
@serpro69
serpro69 / change-codec.md
Created December 10, 2024 12:27 — forked from dvf/change-codec.md
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@serpro69
serpro69 / poll.sh
Last active November 28, 2024 07:12
github workflow result polling
#!/bin/bash
set -e
show_help() {
echo "Usage: ./test.sh <REPO_OWNER> <REPO_NAME> <WORKFLOW_ID> <COMMIT_SHA>"
echo ""
echo "This script polls the status of a GitHub Actions workflow run."
echo ""
echo "Arguments:"
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the Google coding conventions from Google Java Style
that can be found at https://google.github.io/styleguide/javaguide.html
Checkstyle is very configurable. Be sure to read the documentation at
@serpro69
serpro69 / filtering_dv.js
Created January 5, 2024 09:09 — forked from scottTomaszewski/filtering_dv.js
This DataviewJS View helps to add filtering functionality to a Dataview Table in Obsidian.
/*
This DataviewJS View helps to add functionality to a Dataview Table.
THIS IS A BETA RELEASE - there are bugs and its not feature-complete
Version: v0.6.0
Given a Dataview Query, this view will
- Execute the query
- Extract the headers/columns of the result
- Render filters to adjust the Dataview table results
- Render the table results, filtering and re-rendering on filter changes
@serpro69
serpro69 / canvas_diamond.css
Created September 6, 2023 12:02
obsidian canvas diamond shape
.canvas-node-container:has(.diamond) {
transform:rotate(42deg);
overflow: visible;
contain: none;
position: absolute;
width: 150px;
height: 150px;
}
.canvas-node-content:has(.diamond) {
@serpro69
serpro69 / install_virtualenv.sh
Created July 14, 2023 18:43
python+virtualenv
#!/usr/bin/env bash
# TODO convert to a role in https://github.com/serpro69/ansible-collection-devexp
# installs https://virtualenv.pypa.io/en/latest/index.html
# requires pipx - https://pypi.org/project/pipx/
# pipx install virtualenv
# pip install --user --no-deps virtualenvwrapper # use no-deps to skip installing virtualenv via pip since it's installed via pipx
# export
@serpro69
serpro69 / install_guake.sh
Last active July 14, 2023 18:44
guake installation on popos (ubuntu 22.04)
#!/usr/bin/env bash
# TODO convert to a role in https://github.com/serpro69/ansible-collection-devexp
# https://guake.readthedocs.io/en/latest/user/installing.html#install-from-pypi
is_not_root() {
[ "${EUID:-$(id -u)}" -ne 0 ]
}
# rsync-homedir-excludes
#
# A list of files to exclude when backing up *nix home directories using rsync.
#
# Author: Ruben Barkow-Kuder <https://github.com/rubo77/rsync-homedir-excludes>
# Version: 2019-11-30
#
# #Usage:
# USER=<homedir username here>
# rsync -aP --exclude-from=rsync-homedir-excludes.txt /home/$USER/ /media/$USER/linuxbackup/home/$USER/
@serpro69
serpro69 / dvGoalsProgress.js
Last active February 16, 2023 11:44
obsidian dataview goals tracker
/**
Tracks mission-related KPIs (goals) targets from daily notes.
Daily notes' frontmatter structure:
```
---
mission:
220_01_332:
water: 2000
```dataviewjs
// find dates based on format [[YYYY-MM-DD]]
const findDated = (task)=>{
if( !task.completed ) {
task.link = " " + "[[" + task.path + "|*]]";
task.date="";
const found = task.text.match(/\[\[([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))\]\]/);
if(found) task.date = moment(found[1]);
return true;
}