Skip to content

Instantly share code, notes, and snippets.

View r-k-b's full-sized avatar

Robert K. Bell r-k-b

View GitHub Profile
@r-k-b
r-k-b / power-query-iso-week-year.md
Last active February 8, 2024 21:44 — forked from robkb/power-query-iso-week-year.md
M functions to convert between ISO 8601 Week & Year ⇄ dates (e.g., `2014-12-29` ⇄ `"2015-W01-1"`)
@r-k-b
r-k-b / highlight_cypress_handle.css
Last active September 12, 2023 23:33
highlight source hints
/* https://gist.github.com/r-k-b/0879c379ae1acd0440f88cd4f9a6c2c5 */
[data-cy] {
position: relative;
z-index: 1;
}
[data-cy]::before {
/*content: attr(data-cy);*/
content: "cy";
position: absolute;
z-index: 2;
@r-k-b
r-k-b / hide-mouse-cursor-when-idle.ahk
Last active July 5, 2023 17:05
AutoHotKey: Hide Mouse Cursor When Idle
; Saved from https://autohotkey.com/board/topic/42561-hide-mouse-cursor-when-idle/?p=391177
; see also: https://superuser.com/a/68302/144573
; see also: https://github.com/r-k-b/autohotkeys/blob/master/windows/hide-idle-mouse.ahk
Last_Move := A_TickCount
State := True
Loop
{
MouseGetPos, Mouse_X, Mouse_Y
@r-k-b
r-k-b / run-pty.hippo.json
Last active May 27, 2023 00:58
Spin up helpful dev tools for the Hippo project with `run-pty`.
[
{
"title": "elm-review",
"command": [
"elm-review",
"--watch"
],
"defaultStatus": [
"⏳",
"S"
@r-k-b
r-k-b / workaround wonky mic balance.md
Created March 13, 2023 07:03
Change a video from unbalanced stereo to mono

in case you have a wonky mic where the left channel sounds much louder than the right; here's an ffmpeg command to keep only the left channel in a video file, converting it from stereo to mono:

ffmpeg -i in.mp4 -af "pan=mono| c0=FL" -c:v copy out.mp4
@r-k-b
r-k-b / _use nixpkgs cypress binary before npms broken copy.md
Last active February 4, 2023 17:11
how to use NixOS's Cypress instead of npm's Cypress

Should help with avoiding errors like:

No version of Cypress is installed in: /home/rkb/.cache/Cypress/6.2.1/Cypress

Please reinstall Cypress by running: cypress install

----------

Cypress executable not found at: /home/rkb/.cache/Cypress/6.2.1/Cypress/Cypress
@r-k-b
r-k-b / extract-rfc822-link-from-gmail.user.js
Last active June 27, 2022 17:04
Get an email's RFC822 msgId Link from GMail
@r-k-b
r-k-b / _INFO.md
Last active May 19, 2022 07:28
NixOS flakes and private repos in Azure DevOps / VSTS / visualstudio.com

Examples of working Flake urls to private AzOps repos:

nix run 'git+https://pacifichealthdynamics.visualstudio.com/PHDSys/_git/PHDSys-net?ref=integration&rev=43fb2415eac77af745ef481de769327d95c69fe5#hippoApiRT'
nix run 'git+ssh://pacifichealthdynamics@vs-ssh.visualstudio.com/v3/pacifichealthdynamics/PHDSys/PHDSys-net?ref=integration&rev=43fb2415eac77af745ef481de769327d95c69fe5#hippoApiRT'
@r-k-b
r-k-b / README.md
Last active May 14, 2022 18:35
nix shell for a development environment for a Gradle project

I was getting errors like...

$ ./gradlew build
... snip ...
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildSearchableOptions'.
> A problem occurred starting process 'command '/home/rkb/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre/jbrx-8u202-linux-x64-b1483.49/jre/bin/java''
@r-k-b
r-k-b / get-thread-dump.md
Created October 27, 2021 23:15
take a thread dump from a docker container running a mono process

take a thread dump from a docker container running a mono process

...when the container has no shell, so docker exec -it won't work.

steps

identify the Container ID of the problematic container

$ docker stats