This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ndjsonStream from 'can-ndjson-stream'; | |
const getStream = async () => { | |
try { | |
const response = await fetch(url); | |
const reader = ndjsonStream(response.body).getReader(); | |
let reader; | |
while (!result || !result.done) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* How to process stream and NDJson | |
*/ | |
const matcher = /\r?\n/ | |
const processLine = (line) => { | |
console.log('line', line) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// let metaData = { | |
// information:"", | |
// symbol:"", | |
// lastRefresh:"", | |
// outputSize:"", | |
// timeZone:"" | |
// } | |
let candleOhlcMappings = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: gotestsum | |
# This action works only on pull request | |
# since the reporter requires the PR id to | |
# generate a Checks report. | |
# Using other events will likely fail the action | |
on: [pull_request] | |
jobs: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/sha512" | |
"encoding/base64" | |
"fmt" | |
"math/rand" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"fmt" | |
"reflect" | |
log "github.com/sirupsen/logrus" | |
"github.com/spf13/viper" | |
) | |
type Config struct { | |
MongoHost string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Go-Language implementation of an SSH Reverse Tunnel, the equivalent of below SSH command: | |
ssh -R 8080:127.0.0.1:8080 [email protected] | |
which opens a tunnel between the two endpoints and permit to exchange information on this direction: | |
server:8080 -----> client:8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {object} obj plain object with { key: value } | |
* @param {array} keysToCheck List of keys to check for undefined values e.g. ['a','b','c'] | |
* @example | |
* | |
* const obj = { a: undefined, b: 1, c: 2, d: undefined } | |
* | |
* console.log(keysUndefined(obj)) | |
* returns ['a','d' ] | |
**/ |
NewerOlder