Skip to content

Instantly share code, notes, and snippets.

@alfeugds
alfeugds / bashrc_utils.sh
Last active February 20, 2024 23:10
Bash utils
#################
# log it!
#
# Use it to log a command to a file. Useful when you run commands in the terminal and want to keep history of its output.
#
# usage: log_it [args]
#
# example: log_it df -h
#
# the above command will add both stdout and stderr to a log file called 2024-02-20_16-08-53-df_-h.log
@alfeugds
alfeugds / README.md
Last active January 9, 2023 16:44
Terminal Reference file lookup

Terminal Reference file lookup

Simple bash script to search a text content from a reference text file.

Useful if you keep a bunch of information in a text file and want them to be easily accessible through your terminal. E.g. shell commands, useful links, commonly used node tasks.

Setup:

Create an executable file:

@alfeugds
alfeugds / README.md
Last active September 25, 2023 14:19
AutoHotkey - Media keyboard shortcuts

AutoHotkey - Media keyboard shortcuts

Control media with easy to remember keyboard shortcuts.

Even if you have a keyboard with dedicated media buttons, you'll find these keyboard shortcuts a lot easier to control the media on your computer.

  • Alt + Shift + Space : Pause/Play
  • Alt + Shift + n : Next
  • Alt + Shift + p : Previous
  • Alt + Shift + m : Mute
  • Alt + Shift + + : Volume up
# version
# Betaflight / MATEKF411RX (M41R) 4.0.0 Apr 11 2019 / 07:25:57 (9ad2cc844) MSP API: 1.41
# start the command batch
batch start
board_name MATEKF411RX
manufacturer_id
# name
@alfeugds
alfeugds / CurrencyConverter.cs
Last active July 13, 2023 06:01
Xamarin Forms Currency Mask for Entry fields
using System;
using System.Globalization;
using System.Text.RegularExpressions;
using Xamarin.Forms;
namespace MyProject.Util
{
/// <summary>
/// Converter for using in Entry fields for masked input of currency.
/// <para>The binded property must be of type decimal, and must invoke the PropertyChangedEventArgs event whenever the value is changed, so that the desired mask behavior is kept.</para>