Skip to content

Instantly share code, notes, and snippets.

View Soreil's full-sized avatar
🏠
Working from home

Sjon Kosse Soreil

🏠
Working from home
  • Netherlands
View GitHub Profile
@nathan-osman
nathan-osman / win32.go
Last active August 31, 2023 22:01
Simple Windows GUI application written in Go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
@mbenford
mbenford / get-permutations.cs
Last active October 21, 2021 15:01
Generates all permutations of a set by using LINQ and a recursive approach
public static class Permutations
{
public static IEnumerable<IEnumerable<T>> Get<T>(IEnumerable<T> set, IEnumerable<T> subset = null)
{
if (subset == null) subset = new T[] { };
if (!set.Any()) yield return subset;
for (var i = 0; i < set.Count(); i++)
{
var newSubset = set.Take(i).Concat(set.Skip(i + 1));