Обновляемся
apt update && apt upgradeСтавим docker
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 | import tracer, { Span } from "dd-trace"; | |
| import pg from "pg"; | |
| /** | |
| * Patches pg.Pool to add tracing. | |
| */ | |
| export function patchPgPool(serviceName: string) { | |
| const name = "pg-pool.connect"; | |
| const service = `${serviceName}-postgres`; |
| FROM node:12 | |
| WORKDIR /app | |
| COPY ./package*.json ./ | |
| RUN npm install | |
| ENV PORT=4000 | |
| COPY . . | |
| CMD ["npm","run","start"] |
| import { ValidationArguments, ValidatorConstraintInterface } from 'class-validator'; | |
| import { Connection, EntitySchema, FindConditions, ObjectType } from 'typeorm'; | |
| interface UniqueValidationArguments<E> extends ValidationArguments { | |
| constraints: [ | |
| ObjectType<E> | EntitySchema<E> | string, | |
| ((validationArguments: ValidationArguments) => FindConditions<E>) | keyof E, | |
| ]; | |
| } |
Обновляемся
apt update && apt upgradeСтавим docker
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 Uncle Bob, the well known author of Clean Code, is coming back to us with a new book called Clean Architecture which wants to take a larger view on how to create software.
Even if Clean Code is one of the major book around OOP and code design (mainly by presenting the SOLID principles), I was not totally impressed by the book.
Clean Architecture leaves me with the same feeling, even if it's pushing the development world to do better, has some good stories and present robust principles to build software.
The book is build around 34 chapters organised in chapters.
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="https://unpkg.com/mobx@2.6.0/lib/mobx.umd.js"></script> | |
| <script> | |
| var MobxDemo = Object.create(HTMLElement.prototype); | |
| MobxDemo.attachedCallback = function() { | |
| var state = mobx.observable({ | |
| counter : parseInt(this.getAttribute("counter")) | |
| }) |
| (function () { | |
| 'use strict'; | |
| /** | |
| * wraps a promise in a timeout, allowing the promise to reject if not resolve with a specific period of time | |
| * @param {integer} ms - milliseconds to wait before rejecting promise if not resolved | |
| * @param {Promise} promise to monitor | |
| * @example | |
| * promiseTimeout(1000, fetch('https://courseof.life/johndoherty.json')) |
| const Transaction = require('loopback-datasource-juggler'); | |
| const update = async (ids, delta) => { | |
| const result = []; | |
| const tx = await models.MyModel.beginTransaction({ isolationLevel: Transaction.READ_COMMITTED }); | |
| try { | |
| for (const id of ids) { | |
| const entity = await updateById(id, delta, { transaction: tx }); | |
| result.push(entity); | |
| } |
| FROM golang:1.6.2 | |
| COPY . /go | |
| RUN go get github.com/nats-io/nats | |
| RUN go build api-server.go | |
| EXPOSE 8080 | |
| ENTRYPOINT ["/go/api-server"] |