Skip to content

Instantly share code, notes, and snippets.

@gagarine
gagarine / win11-mouse-scroll-reverse.md
Last active April 25, 2024 06:54
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 / fish_install.md
Last active April 17, 2024 20:06
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

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 / 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
@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
@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 / .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 / mysql_multiple_import.bash
Created February 24, 2011 22:34
Import multiple sql file in a mysql database
#!/bin/bash
db=$1
user=$2
passwd=$3
if [ "$db" = "" ]; then
echo "Usage: $0 db_name user password"
exit 1
fi
clear
for sql_file in *.sql; do
https://docs.google.com/presentation/d/1a5dlL01Nh5tnV3isrRC1Hl2DFPci97MLHF5xKhiEv80/edit?usp=sharing
https://docs.google.com/presentation/d/1YxeXNqGYyXbpnA_3N8G7VXGcTLDj_vO_YPFL03f-gdk/edit?usp=sharing
@gagarine
gagarine / template.tpl.php
Created July 29, 2012 21:11
Working with drupal theme_menu_tree
<?php
/**
* Theme_menu_tree doesn't provide any context information
* THIS SUCKS
* But you can use hook_block_view_alter to change the theme wrapper
* OUF!
*/
function MYTHEME_menu_tree(&$variables) {