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 / 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
```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;
}
@serpro69
serpro69 / Hypothesidian.js
Created January 28, 2023 20:51 — forked from TfTHacker/Hypothesidian.js
Hypothes.is - retrieve your annotations into Obsidian (for templater plugin)
<%*
/*
# Hypothes.idian a templater script for retrieving annotations from Hypothes.is
Dev: TfTHacker https://twitter.com/TfTHacker
# Prerequisites:
+ Templater plugin by https://github.com/SilentVoid13/Templater
+ Free Hypothes.is developer token from: https://hypothes.is/account/developer
+ This script will prompt you for his token and save it to a file called "hypothesis config.md"
+ This file store your configuration and can be located any where in your vault.
@serpro69
serpro69 / rainbow-tags.css
Created December 9, 2022 21:42 — forked from raisabelatrix/rainbow-tags.css
Obsidian 1.0+ snippet for rainbow-colored tags. Comes with style settings option
/* β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” β•—
                 STYLE SETTINGS
β•š β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” */
/* @settings
name: Rainbow Tags by raisabelatrix
id: rb-tags-rsbltrx
settings:
-
id: rainbow-tags

2022

Daily Journaling

const dayInMonth = moment().format("D");
const currentMonth = moment().format("M");
var i = 1;
while (currentMonth > i) {
    var entries = entriesSum(i);
    var max = daysInMonth(i);
    var perc = entries + "/" + max;
@serpro69
serpro69 / obsidian-card-view.css
Created December 5, 2022 20:24 — forked from raisabelatrix/obsidian-card-view.css
View Obsidian notes as cards. Add the cssclass card-view to the note's frontmatter to enable card view on reading mode.
.card-view {
--card-width:35em; /*adjust this size if you want narrower or wider cards*/
/*unit has to be in em so that card background will scale along with your font
when you zoom in and out*/
}
/*The Card*/
.card-view .markdown-preview-section {
background-color: var(--background-primary);
margin: 3% auto;
@serpro69
serpro69 / !Description.md
Created November 28, 2022 17:34 — forked from AnubisNekhet/!Description.md
Capacities-like index card callout

Usage

  1. Download and use the capacities-cards.css as a snippet
  2. Copy the raw value of the capacities-index.md file and paste it in your obsidian note

image

3. Edit the callout to your liking

Callouts

capacities-card: Base container for the card

capacities-index: Container for side index

@serpro69
serpro69 / !Description.md
Created November 27, 2022 18:25 — forked from AnubisNekhet/!Description.md
Capacities-like sidebars

Preview

image

Caveats

Since the snippet utilises callouts, the sidebar disappears after a note is scrolled enough for the callout to be outside rendering range, i.e. it's best used for smaller notes. Smaller sidebar sizes are better in this case because there's more scroll area.

Usage

Use the capacities-sidebars.css as a snippet and paste the markdown into a new note.

@serpro69
serpro69 / api_backends.conf
Created October 13, 2022 07:53 — forked from nginx-gists/api_backends.conf
Deploying NGINX Plus as an API Gateway, Part 1
upstream warehouse_inventory {
zone inventory_service 64k;
server 10.0.0.1:80;
server 10.0.0.2:80;
server 10.0.0.3:80;
}
upstream warehouse_pricing {
zone pricing_service 64k;
server 10.0.0.7:80;