Skip to content

Instantly share code, notes, and snippets.

View skynode's full-sized avatar
💭
I may be slow to respond.

Obi skynode

💭
I may be slow to respond.
  • Amsterdam, The Netherlands
View GitHub Profile
@skynode
skynode / .NET6Migration.md
Created October 7, 2021 00:12 — forked from davidfowl/.NET6Migration.md
.NET 6 ASP.NET Core Migration
@skynode
skynode / kubectl.md
Created August 14, 2021 02:07 — forked from so0k/kubectl.md
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@skynode
skynode / AsyncEnumerableExtensions.cs
Created February 25, 2021 16:38 — forked from DCCoder90/AsyncEnumerableExtensions.cs
Convert IEnumerable to IAsyncEnumerable
public static class AsyncEnumerableExtensions
{
public static IAsyncEnumerable<TResult> SelectAsync<T, TResult>(this IEnumerable<T> enumerable,
Func<T, Task<TResult>> selector)
{
return AsyncEnumerable.CreateEnumerable(() =>
{
var enumerator = enumerable.GetEnumerator();
var current = default(TResult);
@skynode
skynode / helm-cheatsheet.md
Created January 17, 2021 07:30 — forked from tuannvm/cka.md
#Helm #Kubernetes #cheatsheet, happy helming!
@skynode
skynode / AsyncLazy.cs
Created June 16, 2020 05:37
AsyncLazy<T> - Stephen Cleary
/// <summary>
/// Provides support for asynchronous lazy initialization. This type is fully threadsafe.
/// </summary>
/// <typeparam name="T">The type of object that is being asynchronously initialized.</typeparam>
public sealed class AsyncLazy<T>
{
/// <summary>
/// The underlying lazy task.
/// </summary>
private readonly Lazy<Task<T>> instance;
@skynode
skynode / JSONInputStream.diff
Created November 8, 2019 04:39 — forked from KengoTODA/JSONInputStream.diff
InputStream from JSONObject. This class will help feeding JSON from the application server.
diff --git a/JSONInputStream.java b/JSONInputStream.java
new file mode 100644
index 0000000..93708ff
--- /dev/null
+++ b/JSONInputStream.java
@@ -0,0 +1,75 @@
+package org.json;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
@skynode
skynode / IndexedPrivilege.md
Created November 7, 2019 10:58 — forked from pthariensflame/IndexedPrivilege.md
An introduction to the indexed privilege monad in Haskell, Scala and C#.

The Indexed Privilege Monad in Haskell, Scala, and C#

We've already looked at two different indexed monads in our tour so far, so let's go for a third whose regular counterpart isn't as well known: the privilege monad.

Motivation

The regular privilege monad allows you to express constraints on which operations a given component is allowed to perform. This lets the developers of seperate interacting components be statically assured that other components can't access their private state, and it gives you a compile-time guarantee that any code that doesn't have appropriate permissions cannot do things that would require those permissions. Unfortunately, you cannot easily, and sometimes cannot at all, build code in the privilege monad that gains or loses permissions as the code runs; in other words, you cannot (in general) raise or lower your own privilege level, not even when it really should be a

@skynode
skynode / IndexedState.md
Created June 7, 2019 00:12 — forked from pthariensflame/IndexedState.md
An introduction to the indexed state monad in Haskell, Scala, and C#.

The Indexed State Monad in Haskell, Scala, and C#

Have you ever had to write code that made a complex series of succesive modifications to a single piece of mutable state? (Almost certainly yes.)

Did you ever wish you could make the compiler tell you if a particular operation on the state was illegal at a given point in the modifications? (If you're a fan of static typing, probably yes.)

If that's the case, the indexed state monad can help!

Motivation

@skynode
skynode / WSE3Client.cs
Created February 6, 2019 08:28
Working with WSE3.0 Services
// Copyright (c) Microsoft Corporation. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography.X509Certificates;
using System.ServiceModel;
using System.ServiceModel.Security;
using System.ServiceModel.Channels;
@skynode
skynode / test.html
Created January 29, 2019 11:26
Hello World Html
<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>