Skip to content

Instantly share code, notes, and snippets.

View rberenguel's full-sized avatar

Ruben Berenguel rberenguel

View GitHub Profile
@rberenguel
rberenguel / pushToTalk.js
Created February 27, 2020 08:54
Push to talk bookmarklet for Mac OS in Safari
javascript: (() => {const toggles = tip => ({ key }) => key === '' && document.querySelectorAll('[data-tooltip]').forEach(el => el.dataset.tooltip === tip && el.click());document.body.onkeyup = toggles('Turn off microphone (⌘ + D)');document.body.onkeydown = toggles('Turn on microphone (⌘ + D)');})();
@rberenguel
rberenguel / pushToTalk.js
Last active February 27, 2020 08:56
Push to talk (space bar when Safari's Meet is under focus) bookmarklet for Google Meet, working under Mac OS in Safari. Code modified from https://gist.github.com/caseywatts/561bc498b6feec3d419b29a65d916663
javascript: (() => {const toggles = tip => ({ key }) => key === '' && document.querySelectorAll('[data-tooltip]').forEach(el => el.dataset.tooltip === tip && el.click());document.body.onkeyup = toggles('Turn off microphone (⌘ + D)');document.body.onkeydown = toggles('Turn on microphone (⌘ + D)');})();
@rberenguel
rberenguel / plugins.md
Created June 25, 2021 14:46
Plugins I'm using in Obsidian as of 20210625
  • Adjacency Matrix: a different way of looking at the graph. Installed for curiosity
  • Admonition: allows having "special" boxes very easily. Very recommended
  • Advanced tables: makes editing tables easier. Not very used, but worth having
  • Calendar: I keep a daily log, so this is very useful to navigate it
  • Dataview: in a way converts your notes into a database. Very helpful to organise projects by adding metadata to notes.
  • Editor syntax highlight: show code syntax in the editor too, not only in the rendered view
  • Excalidraw: awesome SVG plugin that even works on mobile
  • Hotkeys for templates: rarely used, pretty much what it says in the bottle
  • Juggl: alternative graphs
  • Kanban: A kanban based on plan markdown (there's a similar Haskell project). Works well, but not use it much
@rberenguel
rberenguel / obsidianTodayWidget.js
Last active August 20, 2023 20:41
Quick-and-dirty Scriptable (https://scriptable.app/) script to show a medium widget with today's tasks from Obsidian, for my set up (today is in journal/YYYYMMDD.md, tasks are under the `### Plan` heading). Optionally pass "tomorrow" as widget arg to render tomorrow (if it doesn't exist it will fail of course)
let when = args.widgetParameter || 'today'
let now = new Date()
if (when == 'tomorrow') {
now.setDate(now.getDate() + 1);
}
let formatter = new DateFormatter()
formatter.dateFormat = 'yyyyMMdd'
let today = formatter.string(now)
@rberenguel
rberenguel / gist:d5440983c8f49bf1a9822c925176bee7
Last active February 6, 2024 18:57
Flickering candle blink(1) mk2
blink1-tool --hsb 13,80,92 --setpattline 1 -m 754
blink1-tool --hsb 27,90,96 --setpattline 2 -m 802
blink1-tool --hsb 12,95,98 --setpattline 3 -m 982
blink1-tool --hsb 20,100,101 --setpattline 4 -m 959
blink1-tool --hsb 15,85,81 --setpattline 5 -m 782
blink1-tool --hsb 12,93,101 --setpattline 6 -m 758
blink1-tool --hsb 14,81,83 --setpattline 7 -m 992
blink1-tool --hsb 18,100,104 --setpattline 8 -m 627
blink1-tool --hsb 23,95,120 --setpattline 9 -m 992
blink1-tool --hsb 20,90,102 --setpattline 10 -m 897
@rberenguel
rberenguel / rule.sh
Created June 1, 2024 17:46
Hazel rule to analyse exports from DailyGammon magically
echo "" > commands
ID=$(echo "$1" | sed 's/.*dg_\([0-9]*\).*/\1/g')
echo "set sound enable off" >> commands
echo "set analysis chequerplay evaluation plies 3" >> commands
echo "import mat \"$1\"" >> commands
echo "analyse match" >> commands
echo "export match pdf \"reviews/$ID.pdf\"" >> commands
echo "quit" >> commands
/Users/ruben/fromsource/bg/gnubg-1.07.001/gnubg -c commands
rm commands