Skip to content

Instantly share code, notes, and snippets.

View bew's full-sized avatar
😎
https://nohello.net

Benoit de Chezelles bew

😎
https://nohello.net
View GitHub Profile
@bew
bew / 0_Powershell-Testing-Utils.ps1
Created January 17, 2024 18:21
Set of 'package manager' like functions to help setup a powershell testing env
# This module defines helper functions to help with local/CI testing PowerShell code,
# like checking pwsh version, installing up necessary modules..
function Assert-PowerShellVersion {
param(
[Parameter(Mandatory)]
[string]$MinimumVersion
)
if ($PSVersionTable.PSVersion -le [System.Version]$MinimumVersion) {
throw "PowerShell minimum version $MinimumVersion is required, current version is: $($PSVersionTable.PSVersion)"
@bew
bew / Intro to reactive programming.md
Last active December 27, 2021 04:38
Mirror of https://gist.github.com/staltz/868e7e9bc2a7b8c1f754 (soo good intro to reactive programming)

The introduction to Reactive Programming you've been missing

(by @andrestaltz)


This tutorial as a series of videos

If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.

NOTE (@bew in 2021): (link updated) This video series mentions that it's outdated, and I can't find the new one (all I get is 404 pages..).

@bew
bew / introrx.md
Created December 27, 2021 04:29 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@bew
bew / Wezterm changelog, formatted.md
Last active October 9, 2021 20:23
Suggestion to improve wezterm's changelog for readability
{
description = "virtual environments";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05";
inputs.devshell.url = "github:numtide/devshell";
outputs = { self, devshell, nixpkgs }: let
system = "x86_64-linux"; # We only care about a single system
in {
devShell.${system} = let
@bew
bew / Unicode 14.0.0 - Names Database - content.txt
Last active July 3, 2021 17:56
All unicode 14 char names!
; charset=UTF-8
@@@ The Unicode Standard 14.0.0
@@@+ U14M210503.lst
Unicode 14.0.0 names list, ninth delta.
Repertoire synched with UnicodeData-14.0.0d9.txt.
Corrected typo in subhead at 131A3.
Added subhead for Carrier at 15C4.
Updated annotation for 02B9.
Retargeted annotation for 08FB.
Updated annotations for 06C5 and 088E.
@bew
bew / m3u8-to-mp4.md
Created February 7, 2021 11:09 — forked from tzmartin/m3u8-to-mp4.md
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@bew
bew / WSL2 - Python and pip managed by Nix.md
Last active November 8, 2020 20:35
WSL2 - Basic but working python (with pip) managed by Nix

WSL2 - Basic but working python (with pip) managed by the best Nix package manager

Setup WSL2 using Debian to be able to install Nix

  • On WSL2, install the Debian distribution from the microsoft store, then open wsl.exe in a terminal. I recommand using the Microsoft Terminal (this feels weird to say, since I'm more a linux user than a windows user, but when you NEED to use windows....)

    It should open the Debian distrib, with a small bootstrapping script to create a user.

  • Now update the apt package repositories with sudo apt update

@bew
bew / unicode-dump.sh
Created October 14, 2020 01:31
Dump arbitrary ranges of unicode, supports categories (in bash for now)
#!/usr/bin/env bash
# Taken from https://stackoverflow.com/a/59040037/5655255
# and adapted to be a proper cli tool.
function UnicodePointToUtf8
{
# Normalize input
local x="$1" # ok if '0x2620'
x=${x/\\u/0x} # '\u2620' -> '0x2620'
x=${x/U+/0x}; x=${x/u+/0x} # 'U+2620' -> '0x2620'