Skip to content

Instantly share code, notes, and snippets.

View bumbummen99's full-sized avatar
๐Ÿ™ƒ
Branches come and go, but commits stay!

Patrick bumbummen99

๐Ÿ™ƒ
Branches come and go, but commits stay!
View GitHub Profile
@bumbummen99
bumbummen99 / ubuntuDisableMCPLenovo.md
Last active September 16, 2023 04:13
Ubuntu disable MCP (middle click paste) on Lenovo TrackPoint middle button

You may have tried to disable the middle click paste (MCP) feature on ubuntu, likely because you work on a notebook/thinkpad or thinkpad keyboard, just to find out that literally every solution to this "issue" does not apply to ubuntu in specific and does just not work. Also since Linux distros have multiple layers of clipboards there are many ways to solve this and to break other functionality at the same time. The obvious solution is to keep the feature enabled but block it on a keymap level for the specific device that should behave "natural". In order to achieve this behaviour we are going to utilize xinput to modify the device mapping. No other device other than the builtin TrackPoint mouse buttons will be affected.

1) Find out the device id

Type in xinput list | grep 'id=' and guess which device is your builtin TrackPoint. Mine is called 'TPPS/2 Elan TrackPoint'

2) Find out which button corrosponds to the middle mouse button

Xinput utilizes a mapping list for all the devices buttons. In orde

@bumbummen99
bumbummen99 / ConvertStringBooleans.php
Created March 18, 2019 16:29
Converts Strings like 'true', 'on' and 'false' to boolean on Requests in Laravel.
<?php
/**
* Based on https://github.com/laravel/ideas/issues/514#issuecomment-299038674
*/
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TransformsRequest;
@bumbummen99
bumbummen99 / accountmounts.cpp
Last active December 1, 2018 22:08
TrinityCore 3.3.5a AccountMounts. Kinda Blizzlike account mount sharing. Includes optional faction lock and riding skill sharing
#include "Player.h"
class AccountMounts : public PlayerScript
{
static const bool limitrace = true; //Disable share mounts between faction
static const bool limitlevel = true; //Disable share riding with level 1 characters
static const uint8 minRidingLevel = 20; //Minimum level for shared riding skill
public: