Skip to content

Instantly share code, notes, and snippets.

View dikaeinstein's full-sized avatar

Dika Okwa dikaeinstein

View GitHub Profile
@dikaeinstein
dikaeinstein / http_streaming.md
Created February 2, 2022 09:27 — forked from CMCDragonkai/http_streaming.md
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@dikaeinstein
dikaeinstein / axios-instance-config.js
Created September 24, 2021 08:27 — forked from ccnokes/axios-instance-config.js
Good default configuration for axios in node.js
const axios = require('axios');
const http = require('http');
const https = require('https');
module.exports = axios.create({
//60 sec timeout
timeout: 60000,
//keepAlive pools and reuses TCP connections, so it's faster
httpAgent: new http.Agent({ keepAlive: true }),
@dikaeinstein
dikaeinstein / README.md
Created March 17, 2021 22:36 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

Keybase proof

I hereby claim:

  • I am dikaeinstein on github.
  • I am dikaeinstein (https://keybase.io/dikaeinstein) on keybase.
  • I have a public key ASAtGw583pnag389l6VPfoNwTk9WTCHr_-AsvZFZumY6Ngo

To claim this, I am signing this object:

dikaeinstein

Keybase proof

I hereby claim:

  • I am dikaeinstein on github.
  • I am dikaeinstein (https://keybase.io/dikaeinstein) on keybase.
  • I have a public key ASAtGw583pnag389l6VPfoNwTk9WTCHr_-AsvZFZumY6Ngo

To claim this, I am signing this object:

@dikaeinstein
dikaeinstein / terraform_base64_encode_decode.tf
Last active November 5, 2019 13:53
base64 encode and decode multiline values using terraform
base64encode(file(var.private_key_path))
@dikaeinstein
dikaeinstein / LICENSE
Created November 4, 2019 01:28 — forked from x0a1b/LICENSE
Writing delightful middlewares in Go
Copyright (c) 2019 DoorDash
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all

To turn off zoom protocol_handler on chrome. You have to first find the chrome installation path.

Type chrome://version

Then copy the profile path, then cd into that directory. cd ${profile path}.

Then open the Preference file with any text editor and find the "protocol_handler" text. Change the the value of zoommtg from false to true.

Then restart your chrome browser.

@dikaeinstein
dikaeinstein / reverse-proxy.go
Last active July 5, 2019 10:48
A basic reverse proxy with CORS
package main
import (
"flag"
"fmt"
"log"
"net/http"
"net/http/httputil"
"net/url"
)
[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target
[Service]
Type=forking
User=vnc-user
Group=vnc-user
WorkingDirectory=/home/vnc-user