Profile | download (kb/s) | upload (kb/s) | latency (ms) |
---|---|---|---|
Native | 0 | 0 | 0 |
GPRS | 50 | 20 | 500 |
56K Dial-up | 50 | 30 | 120 |
Mobile EDGE | 240 | 200 | 840 |
2G Regular | 250 | 50 | 300 |
2G Good | 450 | 150 | 150 |
3G Slow | 780 | 330 | 200 |
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
import protobuf from 'protobufjs'; | |
const migrationProto = ` | |
syntax = "proto3"; | |
message MigrationPayload { | |
enum Algorithm { | |
ALGORITHM_UNSPECIFIED = 0; | |
ALGORITHM_SHA1 = 1; | |
ALGORITHM_SHA256 = 2; |
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
.modal { | |
position: fixed; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
text-align: left; | |
z-index: 1000; |
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
# Scratch pad for working with Milacares API for monitoring and controlling their air purifier devices. | |
# Based on the code from https://www.stefaanlippens.net/oauth-code-flow-pkce.html for PKCE code verifier and challenge. | |
import base64 | |
import hashlib | |
import html | |
import json | |
import os | |
import re | |
import urllib.parse |
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
# update apt | |
sudo apt update -y | |
# install git | |
sudo apt install -y git | |
# install NodeJS | |
curl -sSL https://deb.nodesource.com/setup_16.x | sudo bash - | |
sudo apt install -y nodejs |
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
import { AbstractFactory } from './AbstractFactory'; | |
import { ConcreteFactory1, ConcreteFactory2 } from './ConcreteFactory' | |
function clientCode(factory: AbstractFactory) { | |
const productA = factory.createProductA(); | |
const productB = factory.createProductB(); | |
console.log(productA.usefulFunctionA()); | |
console.log(productB.usefulFunctionB()); | |
} |
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
import { AbstractFactory } from 'AbstractFactory'; | |
import { ConcreteProductA1, ConcreteProductA2 } from 'ProductA'; | |
import { ConcreteProductB1, ConcreteProductB2 } from 'ProductB'; | |
export class ConcreteFactory1 implements AbstractFactory { | |
public createProductA(): AbstractProductA { | |
return new ConcreteProductA1(); | |
} | |
public createProductB(): AbstractProductB { |
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
export interface AbstractFactory { | |
createProductA(): AbstractProductA; | |
createProductB(): AbstractProductB; | |
} |
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
export interface AbstractProductB { | |
usefulFunctionB(): string; | |
} | |
export class ConcreteProductB1 implements AbstractProductB { | |
public usefulFunctionB(): string { | |
return "The result of the product B1."; | |
} | |
} |
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
export interface AbstractProductA { | |
usefulFunctionA(): string; | |
} | |
export class ConcreteProductA1 implements AbstractProductA { | |
public usefulFunctionA(): string { | |
return "The result of the product A1."; | |
} | |
} |
NewerOlder