Skip to content

Instantly share code, notes, and snippets.

View danielrotaermel's full-sized avatar

Daniel Rotärmel danielrotaermel

View GitHub Profile

Ubuntu Setup

Kinto

Install gnome-tweak-tool to get keyboard lazout with umlauts.

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install gnome-tweaks
@danielrotaermel
danielrotaermel / google-dynamic-dark-mode.js
Last active April 27, 2021 01:04
userscript to dynamically set dark/light mode on google according to os settings
// ==UserScript==
// @name Google Dynamic Dark Mode
// @description dynamically set dark/light mode on google according to os settings
// @author Daniel Rotaermel
// @match *://*google.com*
// ==/UserScript==
let shouldUseDarkmode = window.matchMedia('(prefers-color-scheme: dark)')
.matches;
@danielrotaermel
danielrotaermel / shadowBelow.css
Created March 10, 2021 16:30
shadow below adjacent elements
/* shadow below adjacent elements */
.shadowBelow {
position: relative;
}
.shadowBelow:before {
content: "";
position: absolute;
top: 0;
bottom: 0;
@danielrotaermel
danielrotaermel / toggle-pip-safari-shortcut.js
Created November 8, 2020 19:24
UserScript: Toggle picture-in-picture in safari (ctrl+p)
// ==UserScript==
// @name Toggle picture-in-picture
// @description Toggle picture-in-picture in safari (ctrl+p)
// @license MIT
// @author Daniel Rotärmel
// @namespace https://gist.github.com/danielrotaermel
// @match *://*.*
// ==/UserScript==
document.onkeyup = function(e) {
@danielrotaermel
danielrotaermel / toggle-pip.applescript
Last active December 8, 2023 22:31
Applescript to toggle picture-in-picture globally - I assign this to a keyboard shortcut with better touch tool (cmd+ctrl+p). Make sure "Developer > Allow JavaScript from Apple Events" is enabled in Safari. Download BTT preset -> https://share.folivora.ai/sharedPreset/caa1198d-36dd-4aeb-89de-142bf39cc336
(*
Description: Applescript to open/close picture-in-picture in Safari
Supported Applications: Safari, IINA
Author: Daniel Rotärmel
Source: https://gist.github.com/danielrotaermel/201f549d5755ea886eb78bb660133722
Instructions:
Assign this to a global keyboard shortcut with better touch tool / hammerspoon etc. - suggested: cmd+ctrl+p.
Make sure "Developer > Allow JavaScript from Apple Events" is enabled in Safari.
Download the BTT preset here -> https://share.folivora.ai/sharedPreset/caa1198d-36dd-4aeb-89de-142bf39cc336
*)
@danielrotaermel
danielrotaermel / close-pip.applescript
Created November 8, 2020 18:45
applescript to close picture-in-picture. I use this script with a keyboard shortcut in better touch tool
-- Author: Daniel Rotärmel
tell application "System Events"
if exists (window 1 of process "PIPAgent") then
click button 1 of (window 1 of process "PIPAgent")
end if
end tell
@danielrotaermel
danielrotaermel / PiPerKeyboardShortcut.js
Created November 5, 2020 13:24
PiPer keyboard shortcut UserScript (ctrl+p)
// ==UserScript==
// @name PiPer Shortcut
// @description This is your new userscript, start writing code
// @match *://*.*
// ==/UserScript==
document.onkeyup = function(e) {
// console.log(e)
// ctrl + p
if (e.ctrlKey && e.key == "p") {

Meeting #1

Date:

Purpose:

Attendees

  • Philipp
  • Ludwig
@danielrotaermel
danielrotaermel / MKMapView+ShowHide.swift
Last active February 2, 2024 04:34
MKAnnotationView extensions to show/hide annotations completely
//
// MKMapView+ShowHide.swift
//
// Created by Daniel Rotärmel on 27.10.20.
//
import MapKit
// MKAnnotationView extensions to show/hide annotations completely
extension MKMapView {
@danielrotaermel
danielrotaermel / await-anthing.js
Last active December 16, 2020 15:22
anonymous async function
// anonymous async function
(async () => {
console.log("use await here!");
})()