Skip to content

Instantly share code, notes, and snippets.

View confluencepoint's full-sized avatar
🏳️
Focusing

confluencepoint confluencepoint

🏳️
Focusing
View GitHub Profile
@mrpmohiburrahman
mrpmohiburrahman / karabiner-config in goku
Created March 14, 2024 00:25
Facing lag when typing.
{:profiles
{:goku {:default true
:alone 80 ; hold for .. ms to register single tap
:held 50 ; TODO: not sure what it's for
:delay 0 ; time after which the key press is delayed
:sim 30}} ; keys need to be pressed within this threshold to be considered simultaneous
:templates {:alfred "osascript -e 'tell application id \"com.runningwithcrayons.Alfred\" to run trigger \"%s\" in workflow \"%s\" with argument \"%s\"'"
:km "osascript -e 'tell application \"Keyboard Maestro Engine\" to do script \"%s\"'"
:open "open -a \"%s\""
}
@marco79cgn
marco79cgn / charging-points-capacity.js
Last active June 23, 2023 17:47
iOS widget, das die Anzahl sowie den Anteil der aktuell belegten Ladepunkte in Deutschland zeigt.
const canvSize = 200;
const canvTextSize = 80;
const canvas = new DrawContext();
canvas.opaque = false;
const battCircleRemainColor = new Color("#32CD33"); // Charge circle remaining color
const battCircleDepletedColor = new Color("#fff");
const battCircleBGColor = new Color('#fff'); // Widget background color
const battCircleTextColor = new Color('#000'); // Widget text color
const labelColor = new Color('#768178')
const textColor = new Color('#34443c')

Ad-free Twitter

Inject this css snippet to remove all ads from your Twitter timeline.

div[data-testid="placementTracking"]:has(path[d="M19.498 3h-15c-1.381 0-2.5 1.12-2.5 2.5v13c0 1.38 1.119 2.5 2.5 2.5h15c1.381 0 2.5-1.12 2.5-2.5v-13c0-1.38-1.119-2.5-2.5-2.5zm-3.502 12h-2v-3.59l-5.293 5.3-1.414-1.42L12.581 10H8.996V8h7v7z"]) {
  display: none;
}
@cdpath
cdpath / code_reviewer.js
Created March 3, 2023 08:34
PopClip OpenAI Code Reviewer
// #popclip extension for ChatGPT
// name: ChatGPT Code Reviewer
// icon: "square filled CR"
// language: javascript
// module: true
// entitlements: [network]
// options: [{
// identifier: apikey, label: API Key, type: string,
// description: 'Obtain API key from https://platform.openai.com/account/api-keys'
// }]
@remi
remi / apple-news.sh
Last active April 14, 2022 05:39
Extract canonical URL from Apple News URL
#!/bin/bash
# Usage:
#
# 1. Create a `apple-news` file somewhere in your $PATH with the content of this file
# 2. That’s it! You can now use the `apple-news` utility:
#
# ```
# $ apple-news https://apple.news/AKoDCWtVEQP2w7Ld657lgIg
# https://www.theguardian.com/technology/2022/mar/30/dyson-launches-zone-air-purifying-bluetooth-headphones-with-visor
@selfire1
selfire1 / resize.scpt
Last active March 20, 2022 10:56
An Applescript to resize windows from the command line
on run argv
-- Variables
set _cmd to (item 1 of argv)
tell application "Finder" to set _bounds to bounds of window of desktop
set _xPos to (item 1 of _bounds)
set _yPos to (item 2 of _bounds)
set _ySize to (item 3 of _bounds)
set _xSize to (item 4 of _bounds)
-- get bounds
-- do split: app1, app2, set split

Karabiner layouts for symbols and navigation

Gavin Sinclair, January 2022

Introduction

I use Karabiner (configured with Gosu) to make advanced key mappings on my Apple computer. Karabiner allows you to create “layers”, perhaps simulating those on a programmable mechanical keyboard. I make good use of these layers to give me easy access (home-row or nearby) to all symbols and navigational controls, and even a numpad.

The motivation is to keep hand movement to a minimum. Decades of coding on standard keyboards has unfortunately left me with hand and wrist pain. I will soon enough own a small split keyboard which will force me to use layers to access symbols etc., so this Karabiner solution, which has evolved over months, is a training run for that.

@zevaverbach
zevaverbach / copy_urls_from_reminders.kmmacros
Last active December 1, 2021 12:17
A Keyboard Maestro macro to copy the URLs from an Apple Reminders list to a text file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>657286652.24957097</real>
<key>Macros</key>
@fhemberger
fhemberger / init.lua
Created November 21, 2021 20:12
Hammerspoon: Switch layout when USB keyboard is plugged in
local usbLogger = hs.logger.new('usb', 'debug')
function configureKeyboard(data)
-- Uncomment the "usbLogger" line below, plug in the USB keyboard and update the USB vendor and product ID
local isKeyboardAffected = data.vendorID == 9610 and data.productID == 89
-- usbLogger.df("eventType %s, pname %s, vname %s, vId %s, pId %s, keyboardAffected %s", data.eventType, data.productName, data.vendorName, data.vendorID, data.productID, isKeyboardAffected)
if isKeyboardAffected and data.eventType == "added" then
hs.keycodes.setLayout("U.S.")
end
if isKeyboardAffected and data.eventType == "removed" then
@ctanis
ctanis / gist:70a2ef077528e5a5c71f8d8473af3e5b
Created November 9, 2021 18:40
use hammerspoon to avoid triggering the menu bar, unless you hold alt
-- don't trigger menubar in fullscreen mode unless you hold alt
stopmenu=hs.eventtap.new({ hs.eventtap.event.types.mouseMoved }, function(e)
local flags=e:getFlags()
if not flags.alt then
if e:location().y<1 then
e:location().y=1
return e
end
end
return nil