Skip to content

Instantly share code, notes, and snippets.

@mridang
mridang / rxjs_fast_paginate.md
Last active October 15, 2024 06:06
rxjs_fast_paginate

I recently needed a blazing fast concurrent to fetch items from an API. Of course, I could use a combination of async-awaits and some cryptic code with promises and so I took a stab at doing this in rxjs.

import { Observable } from 'rxjs';

export function doPaginate<T>(
  fetchPage: (page: number) => Promise<{ totalRows: number; resultItems: T[] }>,
): Observable<T> {
@mridang
mridang / gist:0692a227e6e09fd0176bf9a77b93dc7f
Created October 15, 2024 12:14
Building a weappp 2024 Ed
* Nel
*Csp
*Health
*Version
*Req id
* Timing
* Problems
Csche control
Etag
Cors
module.exports = {
  presets: [
    [
      /**
       * We don't care about the these useless options as they aren't needed.
       *
       * https://babeljs.io/docs/babel-preset-env#bugfixes
       * https://babeljs.io/docs/babel-preset-env#spec
       * https://babeljs.io/docs/babel-preset-env#loose

Delete all CRDs in matching a name

kubectl get crd | grep 'cert-manager.io' | awk '{print $1}' | xargs kubectl delete crd

Find all pods with JSON logs