Skip to content

Instantly share code, notes, and snippets.

@gagarine
gagarine / win11-mouse-scroll-reverse.md
Last active April 28, 2024 00:51
Reverse Mouse Wheel scroll in Windows 11 (Natural Mode like MacOS)

Reverse Mouse Wheel scroll in Windows 11

Chose between natural mode like MacOS or Windows default mode.

Step 1: Open Windows PowerShell in Administrator Mode.

You can do this by going to Start Menu, type PowerShell, and click Run as Administrator.

Step 2: Copy the following code and paste it in the command line of Windows PowerShell:

$mode = Read-host "How do you like your mouse scroll (0 or 1)?"; Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object { "$($_.Name): $($_.DeviceID)"; Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name FlipFlopWheel -Value $mode; "+--- Value of FlipFlopWheel is set to " + (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters").FlipFlopWheel + "`n" }
@gagarine
gagarine / deploy.sh
Created July 30, 2021 12:42
Deploy local nodejs project on Azure App Service using Azure CLI and zip package
#!/bin/sh
echo 'Cleanup...'
rm MyProject-package.zip
rm -r node_modules
echo 'Build...'
npm install
npm run build
zip -r MyProject-package.zip . -x '.git/*' -x 'src/*' -x '.idea/*' -x '.env'
echo 'Deploy...'
az webapp deployment source config-zip --resource-group MyGroup --name MyProject --src MyProject-package.zip
@gagarine
gagarine / gist:a187b44ecff35f68b3f14b257d97c44c
Created March 3, 2021 22:31
MacOS: remove the Firefox message "Your browser is being managed by your organisation"
In the terminal launch the following command and restart Firefox:
sudo defaults write /Library/Preferences/org.mozilla.firefox EnterprisePoliciesEnabled -bool FALSE
To know more about policies => https://support.mozilla.org/en-US/products/firefox-enterprise/policies-customization-enterprise/policies-overview-enterprise
https://docs.google.com/presentation/d/1a5dlL01Nh5tnV3isrRC1Hl2DFPci97MLHF5xKhiEv80/edit?usp=sharing
https://docs.google.com/presentation/d/1YxeXNqGYyXbpnA_3N8G7VXGcTLDj_vO_YPFL03f-gdk/edit?usp=sharing

Firefox write/read a lot on the disk. This can reduce the performance of other program.

In about:config

Reduce latency of session write

browser.sessionstore.interval to 600000 (1 hours)

This value is in ms.Default is 15000ms (every 15 seconde).

@gagarine
gagarine / fish_install.md
Last active April 29, 2024 19:36
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@gagarine
gagarine / survey.r
Last active July 4, 2018 13:48
survey.r
### Packages
install.packages(c( "rstudioapi", "corrplot"))
suppressWarnings(
suppressMessages({
library(rstudioapi)
library(readr)
library(psych)
@gagarine
gagarine / keybase.md
Created April 15, 2018 19:51
keybase.md

Keybase proof

I hereby claim:

  • I am gagarine on github.
  • I am perdrisat (https://keybase.io/perdrisat) on keybase.
  • I have a public key ASDCDme3531K0n5Y30Urub_ld7T8w3Nu4-msaTcuqTNqQgo

To claim this, I am signing this object:

@gagarine
gagarine / .eslintrc.json
Last active March 17, 2021 07:52
package.json with npm script and config for webextension, can be addapted for any JS/HTML app or website.
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
4
@gagarine
gagarine / install-clamav-osx.md
Last active June 7, 2023 07:54
Howto Install clamav on OSX with brew

Howto Install clamav on OSX with brew

Note: on legacy intel system the path may be /usr/local/etc/clamav instead of /opt/homebrew/etc/clamav/

$ brew install clamav
$ cd /opt/homebrew/etc/clamav/
$ cp freshclam.conf.sample freshclam.conf