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
@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 / Event_Emitter.md
Created May 16, 2021 13:57
Class # 1 Event Emitter

Event emitter

const { EventEmitter } = require('events')
const ee = new EventEmitter()

setInterval(() => {
  ee.emit('ping', ` [${Date.now()}]: wake up`)
}, 3000)
@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')
@kenriortega
kenriortega / main.go
Created July 5, 2021 02:48 — forked from StarBuckR/main.go
Golang Ldap Authentication, Bind and Search, including Anonymous Bind
package main
import (
"fmt"
"log"
"github.com/go-ldap/ldap/v3"
)
const (
@kenriortega
kenriortega / proxy.go
Created July 6, 2021 21:52 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"

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
@kenriortega
kenriortega / gist:87c8d1be0c2372670bf5d07717dbcaca
Created January 13, 2022 14:36 — forked from technoweenie/gist:1072829
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET