1 - Building High Performance React Applications – Joe Karlsson – Medium
2 - Software Architecture - The Difference Between Architecture and Design
3 - Live without a (JS) compiler. How to be less afraid of it.
import moment from "moment"; | |
export const msToSeconds = (n: number) => n * 1000; | |
export const getElapsedTime = (date?: number) => { | |
if (!date) return ""; | |
let elapsed = 0; | |
let elapsedPrefix = ""; | |
const timeElapsed = Date.now() - date; |
{"lastUpload":"2020-08-13T20:52:32.602Z","extensionVersion":"v3.4.3"} |
#!/usr/bin/env bash | |
FILES_CHANGED=$(git status -s | sed -En "s/(M|D|\?\?)//pg" | sed -e 's/^[[:space:]]*//') | |
DEPLOY_ALL=$(echo "$FILES_CHANGED" | grep -Ec '^(src\/@core|src\/@runner)') | |
DEPLOY_SERVICES=$(echo "$FILES_CHANGED" | grep -Eo '^src/(.*)-(.*)/' | sed -En "s/(src|\/)//pg") | |
DEPLOY_INFO=$'# If you want to avoid auto deploy, please the following deploy metadata\n\n[DeployServices]:'; | |
if [[ "$DEPLOY_ALL" -ge 1 ]]; then | |
DEPLOY_INFO="$DEPLOY_INFO all"; | |
elif [[ "$DEPLOY_SERVICES" != "" ]]; then |
const promise = n => new Promise((resolve) => setTimeout(() => { | |
console.log(n); | |
resolve(n); | |
}, (n * 1000))); | |
const sequence = (promises) => { | |
return new Promise((resolve, reject) => { | |
let results = []; | |
promises | |
.reduce((chain, promise) => { |
#!/bin/sh | |
port=-1 | |
get_unused_port() | |
{ | |
while [ "$port" -eq "-1" ] | |
do | |
p="$(jot -r 1 4444 65000)" | |
r=$(nc -z 127.0.0.1 $p > /dev/null 2>&1 && echo "used") |
import * as http from "http"; | |
import * as https from "https"; | |
import * as HttpError from "standard-http-error"; | |
import { URL } from "url"; | |
export default function makeRequest(url: string, options: any = {}): any { | |
if (!url) { | |
throw new Error("Invalid url"); | |
} | |
return new Promise((resolve, reject) => { |
function isValidDocument(document) { | |
if (!document) return false; | |
if (document.includes('-')) { | |
document = document.replace(/-/g, ''); | |
} | |
let verificador = 0; | |
let digito = 0; | |
let digitoVerificador = 0; | |
let digitoImpar = 0; | |
let sumaPar = 0; |
#include<iostream> | |
#include<cstdlib> | |
#include<string> | |
#include<cstdio> | |
using namespace std; | |
const int TABLE_SIZE = 128; | |
class HashEntry | |
{ | |
public: |
#include <iostream> | |
using namespace std; | |
template <typename T, int N> | |
int binarySearch(T(&array)[N], int toSearch) { | |
int start = 0; | |
int length = N - 1; | |
while (start <= length) { |