Skip to content

Instantly share code, notes, and snippets.

View oasido's full-sized avatar
🐳

Ofek Asido oasido

🐳
View GitHub Profile
@oasido
oasido / gist:d255ee7affc34303e6563f54162ecd46
Created May 23, 2024 16:23 — forked from jtdp/gist:5443498
Revert file permission changes in local git repository.. Very useful when you change permissions due to working on a samba share. Lifted from: http://stackoverflow.com/questions/2517339/git-how-to-recover-the-file-permissions-git-thinks-the-file-should-be
git diff -p \
| grep -E '^(diff|old mode|new mode)' \
| sed -e 's/^old/NEW/;s/^new/old/;s/^NEW/new/' \
| git apply
@oasido
oasido / README.md
Created November 9, 2022 18:23 — forked from amazingidiot/README.md
Pipewire virtual devices as systemd user services

Create pipewire virtual devices as systemd user services

Add both files to ~/.config/systemd/user/ and enable them via systemctl --user enable --now pipewire-source-stereo@sourcename.service or systemctl --user enable --now pipewire-sink-stereo@sinkname.service. Change sourcename and sinkname in the command to your needs. You can add multiple devices with different names.

@oasido
oasido / rules.md
Last active October 23, 2022 14:03
my-eslint-prefrences

When using sindresorhus' eslint-plugin-unicorn package, I tend to use the following rules:

"rules": {
    "unicorn/prevent-abbreviations": [
      "error",
      {
        "replacements": {
          "props": false,
 "idx": false,
@oasido
oasido / audio_backup.bat
Created June 29, 2022 13:14
Batch file to export ALL audio settings to a .reg file
:: Directory to save backups
SET backupDir=D:\Backups\Audio Backup
:: Store date as a variable
FOR /f "tokens=2 delims==" %%G in ('wmic os get localdatetime /value') do set datetime=%%G
SET hh=%time:~0,2%
SET hh=%hh: =0%
SET datetime=%datetime:~0,4%-%datetime:~4,2%-%datetime:~6,2% %hh%-%time:~3,2%-%time:~6,2%
:: Create a backup of the current audio settings state