Skip to content

Instantly share code, notes, and snippets.

View pedoc's full-sized avatar
🎯
Focusing

pedoc pedoc

🎯
Focusing
View GitHub Profile
@mahtaran
mahtaran / upgrade-nvm-node.ps1
Created July 10, 2023 15:44
A PowerShell upgrade script for https://github.com/coreybutler/nvm-windows, which will carry over globally installed npm (and pnpm) packages
if ($args -contains "--help" -or $args.Length -eq 0) {
Write-Host "Usage: .\upgrade-node.ps1 <version> [--help] [--mock] [--no-confirm]"
Write-Host "Example: .\upgrade-node.ps1 20.4.0"
Write-Host "You can still use 'lts' or 'latest' as version"
Write-Host "Example: .\upgrade-node.ps1 latest"
Write-Host "Use the --mock flag to preview the changes without actually making them"
Write-Host "Use the --no-confirm flag to skip confirmation"
exit
}
@the-spyke
the-spyke / pipewire.md
Last active September 18, 2024 06:27
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@wllmsash
wllmsash / assigning-static-ip-addresses-in-wsl2.md
Last active August 15, 2024 10:09
Assigning Static IP Addresses in WSL2

Assigning Static IP Addresses in WSL2

WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".

Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios:

@litetex
litetex / Description.md
Last active September 18, 2024 02:25
Serilog (C#): How to get current MethodName, FileName/Path and LineNumber without reflection

Serilog (C#): How to get the current MethodName, FileName/Path and LineNumber without reflection

This is a simple setup for reflectionless logging with serilog using caller information (and a single static class).

See also https://stackoverflow.com/a/46905798

Log.cs

Create your own Log.cs in your Root-Namespace (you can use the class below).

This class is required to detect where the call is coming from; it uses Caller-Information to speed up the program execution, because the attributes are resolved at compile-time.

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active September 20, 2024 03:23
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@xrman
xrman / gist:4468f545b169969466bceb694d742dad
Created March 12, 2019 21:47
FastStone Capture Full Serial Key
Registration Code
Name : www.xyraclius.com
Serial : OOCRYIMDMDPWRETFPSUZ
@thales17
thales17 / msys2-SDL2-Setup.md
Last active August 14, 2024 17:07
msys2 sdl2 setup

Download and install msys2 64bit

Update msys2

  • Update msys2 64bit after install by running pacman -Syu if pacman needs to be updated you might have to close and reopen the terminal and run pacman -Syu again

Install build tools

  • pacman -S git mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_mixer mingw64/mingw-w64-x86_64-SDL2_image mingw64/mingw-w64-x86_64-SDL2_ttf mingw64/mingw-w64-x86_64-SDL2_net mingw64/mingw-w64-x86_64-cmake make

Compile Hello World

@CTimmerman
CTimmerman / .prospector.yaml
Last active May 16, 2024 04:45
Out Of Memory (OOM) Killer to save your SSD and other processes.
pylint:
disable:
- line-too-long
- multiple-imports
- pointless-string-statement
- too-many-nested-blocks
@mjs3339
mjs3339 / BoyerMoore.cs
Last active August 5, 2024 02:57
C# High Performance Boyer Moore Byte Array Search Algorithm
public class BoyerMoore
{
private int[] _jumpTable;
private byte[] _pattern;
private int _patternLength;
public BoyerMoore()
{
}
public BoyerMoore(byte[] pattern)
{