Skip to content

Instantly share code, notes, and snippets.

View KleaTech's full-sized avatar

Adam Bozzay KleaTech

View GitHub Profile
@KleaTech
KleaTech / oculus_recording_notes.txt
Created January 7, 2022 23:08
Oculus Quest recording settings
# `adb` commands to call for capturing high-res videos on Oculus VR headsets
#
# Usage:
#
# curl https://gist.githubusercontent.com/cvan/54535a41db8a67d0370971f6e393675d/raw/c2183adf4bf0e85edc422a13599eba54e62ee473/video-setprop.sh > /tmp/oculusvr-video-setup.sh
# chmod +x /tmp/oculusvr-video-setup.sh
# ./tmp/oculusvr-video-setup.sh
#
# Source: modified from https://github.com/MozillaReality/FirefoxReality/wiki/Tips-for-recording-videos
#
@KleaTech
KleaTech / docker_rm_all
Last active February 9, 2022 14:45
Remove all docker images, containers on Windows (one liner)
From command line:
FOR /f "tokens=*" %i IN ('docker ps -aq') DO docker rm -f %i
FOR /f "tokens=*" %i IN ('docker images --format "{{.ID}}"') DO docker rmi -f %i
docker builder prune -a
From batch file:
FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm -f %%i
FOR /f "tokens=*" %%i IN ('docker images --format "{{.ID}}"') DO docker rmi -f %%i
docker builder prune -a
@KleaTech
KleaTech / find_ranked_maps.txt
Created May 18, 2022 16:28
Find Beat Saber ranked maps on Quest
./adb shell find "/mnt/sdcard/ModData/com.beatgames.beatsaber/Mods/SongLoader" -iname "info.dat" | foreach { $dir=$_.split("/")[-2]; ./adb pull $_ "c:/Temp/$dir.dat" }
Get-ChildItem | foreach {$_.name.replace("custom_level_", "").replace(".dat", "")} | where { $_.length -eq 40 } | where {$res=(invoke-webrequest -uri "https://scoresaber.com/api/leaderboard/by-hash/$_/info?difficulty=9" -SkipHttpErrorCheck); $res.StatusCode -eq 200 -and ($res.Content -match '"ranked": true')}
Run only tests that has .only or all of them if there's no .only
grep --exclude-dir=node_modules -rl . -e 'test.only\|it.only\|describe.only' --null | tr '\n' ' ' | xargs -0 npx jest | grep . || npx jest
clear && grep --exclude-dir=node_modules -rl . -e 'test.only\|it.only\|describe.only' --null | tr '\n' ' ' | xargs -0 npx jest --coverage=false
@KleaTech
KleaTech / gist:a2b4e345d00ad404beae53ed7d040eb5
Last active December 26, 2023 16:40
Worst computer bugs
British Post Office scandal https://www.youtube.com/watch?v=hCdI3UfQ1L4
Therac-25 https://www.youtube.com/watch?v=Ap0orGCiou8
ethiopian airlines flight 645 https://www.youtube.com/watch?v=lpJjWzCbsAc
@KleaTech
KleaTech / gist:232a3a32b9415d18bf35087843d961a0
Created January 3, 2024 09:01
Cypress process_profiler parser regex
\[32;1mcypress:server:util:process_profiler[^│]*│[^│]*│\W*'TOTAL'\W*│[^│]*│[^│]*│[^│]*│[^│]*│\W*([\d\.]*)\W*│\W*([\d\.]*)\W*│\W*([\d\.]*).*$
@KleaTech
KleaTech / .zshrc
Created March 28, 2024 09:01
Macos .zshrc file
alias cmd='open -a Terminal "`pwd`"'
npr() { npm run $@ }
export PATH="/opt/homebrew/bin:$PATH"
clear() { printf '\33c\e[3J' }
export PATH="/opt/homebrew/opt/openjdk@11/bin:$PATH"
gitPruneBranches() { git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done }
gitMergeMain() { git rev-parse --abbrev-ref HEAD | read currentBranch && git checkout main && git pull && git checkout $currentBranch && git merge main -m "merge
main" }
gitCheckoutUnderMain() { git add . && git stash && git checkout main && git stash pop && git checkout -b $1 }
@KleaTech
KleaTech / commands.ts
Created July 24, 2024 13:01
Cypress custom command similar to .then() but with retry-ability
declare global {
namespace Cypress {
interface Chainable<Subject> {
/**
* Custom command similar to cy.then() but with retry-ability
* @example cy.get('@jsonString').transformValue(JSON.parse).should('deep.equal', expectedValue)
* Note: If a .should() assertion is successful, the retry chain is stopped.
* So eg. cy.get('@jsonString').should('exist').transformValue(JSON.parse) will not query the jsonString again once it exists.
*/
transformValue<T>(transformFn: (subject: Subject) => T): Chainable<T>;