Skip to content

Instantly share code, notes, and snippets.

@Jyosua
Jyosua / swagger-standalone-install.sh
Created August 16, 2024 06:49
Bash script for quick standalone installations of Swagger UI
#!/bin/bash
echo "Downloading the latest Swagger UI release..."
LATEST_VERSION=$(curl -s https://api.github.com/repos/swagger-api/swagger-ui/releases/latest | grep '"tag_name"' | cut -d '"' -f 4)
echo "The latest release version is: $LATEST_VERSION"
ZIP_FILE="swagger-ui-$LATEST_VERSION.zip"
curl -L -o "$ZIP_FILE" "https://github.com/swagger-api/swagger-ui/archive/refs/tags/$LATEST_VERSION.zip"
@Jyosua
Jyosua / go-wsl.md
Last active November 12, 2021 17:51 — forked from renevo/go-wsl.md
Easily update/install Go in wsl

Updating/Installing Go in WSL Debian

Remove

Removes older versions

sudo rm -rf /usr/local/go* && sudo rm -rf /usr/local/go
@Jyosua
Jyosua / combination.cs
Created May 15, 2018 06:00
Just some basic C# code for generating unique combinations from 1 to N
using System;
using System.Collections.Generic;
using System.Linq;
namespace StudyCode
{
public static class Combination
{
public static List<int[]> Combinations(HashSet<int> availableNumbers, int[] currentArray, int index)
{
@Jyosua
Jyosua / ImageEx.cs
Last active November 27, 2019 01:44 — forked from andreinitescu/gist:c907c2951a719ed3ac34
Xamarin.Forms Image subclass that finds the aspect needed to fill the view in one axis, and then dynamically expands the view in the other axis to fit the image without scaling.
public class ImageEx : Image
{
public static readonly BindableProperty TrueAspectProperty =
BindableProperty.Create(
propertyName: nameof(TrueAspect),
returnType: typeof(AspectEx),
declaringType: typeof(AspectEx),
defaultValue: AspectEx.AspectFit,
defaultBindingMode: BindingMode.OneWay,
propertyChanged: OnAspectExPropertyChanged);