-
Visual Studio Code: https://code.visualstudio.com/download
- Color theme: Monokai
- Windows font, size 10: Open Sans https://fonts.google.com/specimen/Open+Sans
- Monospaced font, size 14: Cousine https://fonts.google.com/specimen/Cousine
- Monospaced font, size 14, with ligatures: Liga Cousine https://github.com/davalapar/LigaCousine
-
Cygwin: https://cygwin.com/install.html
- gcc-g++, gcc-core, make, gdb (for CLion)
- git, curl, wget, putty, openssh, chere
https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
Dijkstra's algo can be used for path-finding in a p2p network, which comes handy when relaying information as a unicast (between 2 peers) or multicast (between 3 peers). Instead of relying on the very unreliable geographical data (lat/long) their devices can provide, their network latency values can used instead.
Requirements:
- Clients should determine the latency of their direct peers periodically.
- Clients should be able to relay the messages in a forward and backward manner
- Client should be able to group the messages
- Encoding of messages
This file contains 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
var saveData = (function () { | |
var a = document.createElement("a"); | |
document.body.appendChild(a); | |
a.style = "display: none"; | |
return function (data, fileName) { | |
var json = JSON.stringify(data), | |
blob = new Blob([json], {type: "octet/stream"}), | |
url = window.URL.createObjectURL(blob); | |
a.href = url; | |
a.download = fileName; |
This file contains 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
// 'downloadFile.js', written by blending two solutions: | |
// 'js-download' https://github.com/kennethjiang/js-file-download | |
// 'Anders Paulsen' https://blog.jayway.com/2017/07/13/open-pdf-downloaded-api-javascript/ | |
export function downloadFile(data, filename, mime) { | |
// It is necessary to create a new blob object with mime-type explicitly set | |
// otherwise only Chrome works like it should | |
const blob = new Blob([data], {type: mime || 'application/octet-stream'}); | |
if (typeof window.navigator.msSaveBlob !== 'undefined') { | |
// IE doesn't allow using a blob object directly as link href. |
This file contains 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
/* eslint-disable no-console, no-undef, arrow-body-style */ | |
import sha256 from 'fast-sha256/sha256'; | |
import pako from 'pako'; | |
import msgpack5 from 'msgpack5'; | |
import nacl from 'tweetnacl'; | |
import naclutils from 'tweetnacl-util'; | |
import prettybytes from 'pretty-bytes'; | |
export const fromUTF8 = naclutils.decodeUTF8; |
- Adding package on windows
- Install Windows SDK 8.1 https://developer.microsoft.com/en-us/windows/downloads/sdk-archive
- Create folder
C:\OpenSSL-Win64\
(exact) - Download
http://www.indyproject.org/Sockets/fpc/AMD64-Win64OpenSSL-0_9_8g.zip
- (or from here:
http://www.indyproject.org/Sockets/fpc/OpenSSLforWin64.en.aspx
) - Extract to folder
cd C:\OpenSSL-Win64
mkdir lib
copy libeay32.lib lib
yarn add greenlock ursa
This file contains 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
https://stackoverflow.com/a/49825905 |
This file contains 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
/* eslint-disable no-undef */ | |
// http://keycode.info | |
class Keylock { | |
constructor(key) { | |
this.keyCode = key.charCodeAt(0); | |
this.isDown = false; | |
this.isUp = true; | |
this.onPress = undefined; | |
this.onRelease = undefined; |
This file contains 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
// unfinished | |
let externalVariable = 1; | |
class Externa{ | |
constructor () { | |
this.map = new Map(); | |
} | |
set x (value) { | |
this.map.set('x', value); | |
} | |
get x () { |
OlderNewer