Skip to content

Instantly share code, notes, and snippets.

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

Kenrique Ortega kenriortega

🏠
Working from home
View GitHub Profile
@mjul
mjul / elasticsearch.fsx
Last active June 1, 2022 08:15
Elasticsearch in F# example
// paket add nuget NEST
#I "../../packages"
#r "Elasticsearch.Net/lib/net46/Elasticsearch.Net.dll"
#r "NEST/lib/net46/Nest.dll"
open System
//open Elasticsearch.Net
open Nest
@kenriortega
kenriortega / stream.class.md
Created May 7, 2021 23:34
Node.js Basic Stream data

Clase de stream nodejs API

'use strict'

const fs = require('fs')
const zlib = require('zlib')
const http = require('http')

Fastify Basic

Servicio rest con fastify cors, helmet, rate limit, autoload

import Fastify from 'fastify'
import { dirname, join } from 'path'
import { fileURLToPath } from 'url'
import AutoLoad from 'fastify-autoload'
@kenriortega
kenriortega / Binary_Encoding.md
Last active June 7, 2021 00:11
Binary Encoding

Binary Encoding

MsgPack

'use strict'

const fs = require('fs')
@kenriortega
kenriortega / Fastify_MSGPack.md
Last active November 14, 2024 15:05
MsgPack and Fastify

How to use fastify and msgpack

Create a simple plugin to manage binary data with msgpack

'use strict'

const fp = require('fastify-plugin')
const msgpack = require('@msgpack/msgpack')
@kenriortega
kenriortega / ProtoBuf_Fastify.md
Created May 16, 2021 17:09
Protobuf.js and fastify

How to use fastify and protobuf

Create a simple plugin to manage binary data with protobuf

'use strict'

const fp = require('fastify-plugin')
const protobufjs = require('protobufjs')
@justincastilla
justincastilla / creating_a_redis_cluster.md
Last active February 14, 2024 04:28
Creating a Redis Cluster

Step 1

To create a cluster, we need to spin up a few empty Redis instances and configure them to run in cluster mode.

Here’s a minimal configuration file for Redis Cluster:

# redis.conf file
port 7000
@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active May 12, 2024 14:24
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {