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
| const http = require('http'); | |
| const server = http.createServer(function(req, res) { | |
| let bodySize = 0; | |
| req.on('data', function(chunk) { | |
| bodySize += chunk.byteLength; | |
| }); | |
| req.on('end', function() { | |
| const time = new Date().toISOString(); | |
| const json = { |
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
| /* eslint-disable @typescript-eslint/camelcase */ | |
| // Type definitions based on https://www.npmjs.com/package/@types/ioredis | |
| import { ConnectionOptions } from 'tls'; | |
| import { Readable } from 'stream'; | |
| import { EventEmitter } from 'events'; | |
| declare class Commander { | |
| getBuiltinCommands(): string[]; | |
| createBuiltinCommand(commandName: 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
| function toPlainObject(source) { | |
| const target = {}; | |
| for (const key of Object.keys(source).sort()) { | |
| const value = source[key]; | |
| if (!(null === value || '' === value)) { | |
| if (typeof value === 'object') { | |
| target[key] = value instanceof Date ? value.toISOString() : toPlainObject(value); | |
| } | |
| else { | |
| target[key] = value; |
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
| function createUploadFormData(data, file) { | |
| const formData = new FormData(); | |
| for(const field in data.fields) { | |
| formData.append(field, data.fields[field]); | |
| } | |
| formData.append('file', file); | |
| return formData; | |
| } | |
| async function presignUpload(data, file) { |
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
| const fs = require('fs'); | |
| const migrationTemplate = ` | |
| import { MigrationInterface, QueryRunner } from "typeorm"; | |
| export class {{name}} implements MigrationInterface { | |
| name = '{{name}}'; | |
| public async up(queryRunner: QueryRunner): Promise<void> { | |
| await queryRunner.query({{up}}); |
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 { Subject } from 'rxjs'; | |
| export class Change { | |
| constructor(public name: string, public value: string) {} | |
| toJSON() { | |
| return {[this.name]: this.value}; | |
| } | |
| } |
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
| { | |
| "$schema": "http://json-schema.org/draft-07/schema#", | |
| "title": "SurveyJS Library json schema", | |
| "type": "object", | |
| "properties": { | |
| "pages": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/definitions/page" | |
| } |
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
| #!/bin/bash | |
| DIR=$PWD | |
| pushd . > /dev/null | |
| cd /Users/taras/Public/github.com/kissarat/auxiliary/bin | |
| if [ -z $1 ]; then | |
| ./activate ${DIR} | |
| else | |
| ./activate $1 | |
| fi |
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
| rumour - чутка | |
| proficiency - майстерність | |
| feat - подвиг | |
| predominantly - переважно | |
| predominant - переважаючий | |
| enviable - заздрісний | |
| inevitably - неминуче | |
| instalment - окремий випуск | |
| deride - насміхатися | |
| dissect - розсікати |
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
| apt update | |
| apt upgrade | |
| apt install nginx vsftpd openssh-server vim htop nodejs postgresql | |
| useradd web -m |