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 / 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 / RecursiveReplace.ps
Created September 19, 2018 10:48 — forked from jongalloway/RecursiveReplace.ps
Recursive replace in files (PowerShell)
$find = 'jquery-1\.4\.4'
$replace = 'jquery-1\.5\.1'
$match = '*.cshtml' , '*.vbhtml'
$preview = $true
foreach ($sc in dir -recurse -include $match | where { test-path $_.fullname -pathtype leaf} ) {
select-string -path $sc -pattern $find
if (!$preview) {
(get-content $sc) | foreach-object { $_ -replace $find, $replace } | set-content $sc
}
@skynode
skynode / README.md
Created August 17, 2018 01:27 — forked from hofmannsven/README.md
My simply Git Cheatsheet
0x00 0 STOP
0x01 3 ADD
0x02 5 MUL
0x03 3 SUB
0x04 5 DIV
0x05 5 SDIV
0x06 5 MOD
0x07 5 SMOD
0x08 8 ADDMOD
0x09 8 MULMOD