Skip to content

Instantly share code, notes, and snippets.

View danielepolencic's full-sized avatar
💭
☸️

Daniele Polencic danielepolencic

💭
☸️
View GitHub Profile
import { LevelUp } from 'levelup'
import { Transform } from 'stream'
export function Document(db: LevelUp) {
return { createCollection }
function createCollection<T>({ collection }: { collection: string }) {
return <
Indexers extends {
[name: string]: {
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-addon: cluster-autoscaler.addons.k8s.io
k8s-app: cluster-autoscaler
name: cluster-autoscaler
namespace: kube-system
---
@danielepolencic
danielepolencic / nsm.md
Last active April 10, 2023 17:45
Nginx Service Mesh — installation instructions

Nginx Service Mesh (NSM)

You will install the Nginx Service Mesh locally using minikube.

Launch a new cluster with:

minikube start \
  --extra-config=apiserver.service-account-signing-key-file=/var/lib/minikube/certs/sa.key \
 --extra-config=apiserver.service-account-key-file=/var/lib/minikube/certs/sa.pub \
@danielepolencic
danielepolencic / minikube-windows.md
Created November 30, 2020 03:39
Note for running minikube on Windows.

Minikube is a tricky beast on Windows.

There are several options to run minikube on Windows:

  1. WSL2
  2. HyperV
  3. VirtualBox

The easiest option is to run minikube with VirtualBox.

@danielepolencic
danielepolencic / redux.ts
Created September 9, 2020 03:02
Redux toolkit + redux-thunk end-to-end demo
import { createAsyncThunk, createSlice, configureStore, Dispatch, AnyAction } from '@reduxjs/toolkit'
import thunk, { ThunkDispatch } from 'redux-thunk'
const userAPI = {
async fetchById(id: string) {
return new Promise<{ data: number }>(resolve =>
setTimeout(() => {
resolve({ data: 1 })
}, 4000),
)