Skip to content

Instantly share code, notes, and snippets.

@gagarine
gagarine / win11-mouse-scroll-reverse.md
Last active May 15, 2024 18:30
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" }
@lucakiebel
lucakiebel / mongodump_in_docker-compose.sh
Last active May 15, 2024 18:28
Use Mongodump and Mongorestore to backup and restore MongoDB Databases run in docker-compose
docker-compose exec -T mongodb mongodump --authenticationDatabase admin -u root -p password --db test --archive --gzip > dump.gz
@protrolium
protrolium / ffmpeg.md
Last active May 15, 2024 18:27
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@soatok
soatok / matrix.md
Last active May 15, 2024 18:26
Why I Don't Trust Matrix Developers to Produce a Secure Protocol

Ever since I wrote It's Time For Furries to Stop Using Telegram, I've had a few folks ask me about my opinion on Matrix.

(I've also had a few people evangelize Matrix in my mentions. That's annoying.)

My stance on Matrix has been the same for years: I don't trust the Matrix developers to produce a secure protocol, and until they abandon Olm / Megolm in favor of something like MLS, I'm adamant about refusing to trust their team's designs.

To understand why I feel so strongly about this, you need to understand that practically exploitable vulnerabilities were found in Matrix in 2022.

It isn't enough that there were vulnerabilities found to be alarming. Vulnerabilities happen. You aren't writing software if you don't occasionally fuck up.

@aidos-dev
aidos-dev / README.md
Last active May 15, 2024 18:26
How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

Step 1.

Open your terminal.

In the root directory run the command:

sudo nano /etc/bluetooth/main.conf
@ntrf
ntrf / 1-QuickClipExplanation.md
Last active May 15, 2024 18:24
QuickClip explanation.

Each entity in source engine has two hitboxes - one in quake physics world, and another in havok (or vphys) physics world. This second hitbox is called "physics shadow".

Depending on type of the entity one of the hitboxes is dominant. Each frame results of havok physics simulation for barrels, rollermines, vehicles and etc will be copied over quake hitboxes of entities. For NPCs, rockets and elevators state is copied in reverse direction - quake to havok.

Player is special. Normally quake hitbox will overwrite havok shadow, but only if its movement is not blocked by any havok hitboxes. Player's hitbox will be copied in reverse - from havok to quake - if (a) havok hitbox is valid (not stuck in quake world), (b) player is touching a vphys object.

Quickclip works, because in vehicles havok hitbox has collisions masked out for everything except pickups (health, ammo). When you exit a vehicle, collision mask for havok physics should be changed to normal, but only if vehicle is present in the world. Barnacle fo

@ORESoftware
ORESoftware / resize-base64.js
Last active May 15, 2024 18:20
resizing an image on the front-end before sending to a server
// Using this code, we can retrieve an image from a user's filesystem, resize the image, and then upload the image
// to a server using AJAX. Because we use base64 encoding, we can just include the image data as just another string value
// in a JSON payload.
// So we can use AJAX to send the file to a server, which is convenient.
// We have one line of relevant html
// get file in the first place => <input type="file" custom-on-change="onAcqImageFileChange" class="form-control">
#!/usr/bin/env python3
'''
always getting the most recent frame of a camera
================================================
Usage:
------
freshest_camera_frame.py
@wojteklu
wojteklu / clean_code.md
Last active May 15, 2024 18:20
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@IT-Berater
IT-Berater / clean_code.md
Last active May 15, 2024 18:19 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.

Clean-code


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.