Skip to content

Instantly share code, notes, and snippets.

View gpproton's full-sized avatar
🎯
Focusing

Godwin Peter .O gpproton

🎯
Focusing
View GitHub Profile
sudo sed -i 's/3/2/' /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
sudo apt install dkms build-essential make
git clone https://github.com/lwfinger/rtw88 && cd rtw88 && make clean && sudo dkms add . && sudo dkms install rtlwifi-new/0.6
//verificar se o "Power Management:off" caso estiver "Power Management:on" deslique e ligue o note
iwconfig
@gpproton
gpproton / github_desktop_ubuntu.sh
Created January 15, 2022 03:52 — forked from berkorbay/github_desktop_ubuntu.md
To install Github Desktop for Ubuntu
## Follow this link for further updates to Github Desktop for Ubuntu https://github.com/shiftkey/desktop/releases/latest
# UPDATE (2021-10-18): Thanks to Amin Yahyaabadi's message, the updated code is as follows
sudo wget https://github.com/shiftkey/desktop/releases/download/release-2.9.3-linux3/GitHubDesktop-linux-2.9.3-linux3.deb
### Uncomment below line if you have not installed gdebi-core before
# sudo apt-get install gdebi-core
sudo gdebi GitHubDesktop-linux-2.9.3-linux3.deb
# UPDATE (2021-03-05): Thanks to PaoloRanzi81's comment, the updated code is as follows https://gist.github.com/PaoloRanzi81
@gpproton
gpproton / android-backup-apk-and-datas.md
Created April 15, 2022 13:50 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

Fetch application APK

@gpproton
gpproton / importing.module.ts
Created August 13, 2022 00:49 — forked from evolkmann/importing.module.ts
Create Nest.js modules with custom config
import { Module } from '@nestjs/common';
import { MyLibModule } from './my-lib.module';
@Module({
imports: [
MyLibModule.register({ name: 'Enzo' }),
]
})
export class ImportingModule {}
@gpproton
gpproton / Segment.xaml
Last active February 15, 2025 05:09
A basic dotnet MAUI sample segment control example using BindableLayout
<!-- Working code -->
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XClaim.Mobile.Views.Segment"
x:Name="this">
<Border Padding="3" StrokeThickness="0" BackgroundColor="{DynamicResource Tertiary}">
<Border.StrokeShape>
<RoundRectangle>
<RoundRectangle.CornerRadius>

Why mediator?

In a ASP.NET Web application. You don't need mediator

  • If you prefers to make controlers depends directly to the Application Codes instead of indirectly via the Mediator.
  • If you prefers to make a normal ASP.NET Web Application instead of a Mediator Application

Frankly it is not a Bad choice, no need to use a Mediator framework or make a Mediator Application just because everyone did.. Though, There are benefits in making a Mediator Application:

  • Event sourcing (Messages broadcast), CQS pattern..
  • Decouple the Controler (presentation) from Application codes, so that you could swap the presentation technology. For eg, if you make a "MassTransit" application, then you can swap the presentation layer to Mediator or RabbitMQ, or Grpc.. => you are not to be sticked with or limited by ASP.NET presentation => but rather sticked with and limited by your mediator framework!

Read Part 1: MediatR vs MassTransit Mediator - Differences

The MassTransit Mediator implementation is more powerful than MediatR implementation, but also more complicate to use. Unit Testing a MassTransit Consumer is not a nice experience.

In this article I will propose some techniques to simplify the MassTransit Consumer and to make them look as straight forward as a MediatR handler.

Case study

We will study a very common use case (the most common use case which I can think of):

@gpproton
gpproton / resolver.py
Last active December 7, 2024 16:26
Quick script for resolving the routes distance and ETA using only simple names of locations
#!/usr/bin/env python3
"""
Copyright (c) 2024 Godwin Peter .O
Licensed under the MIT License
you may not use this file except in compliance with the License.
https://opensource.org/license/mit
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@gpproton
gpproton / simple_background_tasks.py
Last active December 7, 2024 16:27
A simple and standalone script for Long-Running/Background Tasks with Python & asyncio
#!/usr/bin/env python3
'''
Copyright (c) 2024 Godwin Peter .O
Licensed under the MIT License
you may not use this file except in compliance with the License.
https://opensource.org/license/mit
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@gpproton
gpproton / .tmux.conf
Last active January 30, 2025 15:20
A quick and effective tmux config for an effective development environment on my arch linux workstation
set-option -sa terminal-overrides ",xterm*:Tc"
set -g default-terminal 'screen-256color'
set -g mouse on
# Very important change prefix key bindings
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Move status bar to top