Skip to content

Instantly share code, notes, and snippets.

final EzSchema userProfileSchema = EzSchema.shape({
"firstName": EzValidator<String>().required(),
"lastName": EzValidator<String>().required(),
"email": EzValidator<String>().required().email(),
"age": EzValidator<int>().min(18).max(100),
'contactDetails': EzSchema.shape({
'mobile': EzValidator<String>()
.required()
.matches(RegExp(r'^\+\d{10,15}$'), 'Invalid phone number'),
'landline': EzValidator<String?>(optional: true),
@midoriiro
midoriiro / convert-image.psm1
Created November 15, 2023 18:08
Convert OCI image to LXC format
Function Convert-Image
{
Param (
[Parameter(Mandatory = $true)]
[string]$Name,
[Parameter(Mandatory = $true)]
[string]$Tag,
[Parameter(Mandatory = $false)]
@captainsafia
captainsafia / Program.cs
Last active December 11, 2023 06:57
Titan: the small but mighty API framework (requires .NET 7)
using System.Net;
using System.Text;
var port = 8080;
var server = new Server(port);
server.UseAuthentication();
server.UseRouting();
server.UseNotFoundPage();
@edjdavid
edjdavid / file.md
Created October 13, 2022 12:45
Stream Windows webcam/desktop via RTSP

Can be used for streaming data (webcam or screen capture) from the Windows to WSL

Install

  1. Simple RTSP Server
  2. ffmpeg

Get the internal IP of WSL

Run from a WSL terminal

ip route list default | awk '{print $3}'
alias getsecret="_getsecret"
# ~/.secrets/secrets.json !!! chmod 400
# {
# "group1": {
# "secret1":"value",
# "secret2":"value"
# },
#Finder - Full Path in the Title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES|NO
#Finder - Show All Files
defaults write com.apple.finder AllShowAllFiles TRUE|FALSE
#Finder - Add Quit to Menu
defaults write com.apple.finder QuitMenuItem -bool TRUE|FALSE && killall Finder
#Dialogs Print - Show the Extended Print Dialog by default
@davidfowl
davidfowl / MinimalAPIs.md
Last active June 28, 2024 17:42
Minimal APIs at a glance
@slowpeek
slowpeek / bye.sh
Last active June 4, 2022 00:52
bye.sh
# -*- mode: sh; sh-shell: bash; -*-
# shellcheck shell=bash
# MIT license (c) 2021 https://github.com/slowpeek
# Homepage: https://gist.github.com/slowpeek/6127166369d8abd230c30c20cc6a9152
##############################################################
##############################################################
## THIS GIST IS OBSOLETE AND IS NO LONGER UPDATED.
## Use here-bye instead: https://github.com/slowpeek/here-bye