Skip to content

Instantly share code, notes, and snippets.

View kissarat's full-sized avatar
🏠
Working from home

Taras Labiak kissarat

🏠
Working from home
View GitHub Profile
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 = {
/* 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): {};
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;
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) {
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}});
import { Subject } from 'rxjs';
export class Change {
constructor(public name: string, public value: string) {}
toJSON() {
return {[this.name]: this.value};
}
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "SurveyJS Library json schema",
"type": "object",
"properties": {
"pages": {
"type": "array",
"items": {
"$ref": "#/definitions/page"
}
#!/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
rumour - чутка
proficiency - майстерність
feat - подвиг
predominantly - переважно
predominant - переважаючий
enviable - заздрісний
inevitably - неминуче
instalment - окремий випуск
deride - насміхатися
dissect - розсікати
apt update
apt upgrade
apt install nginx vsftpd openssh-server vim htop nodejs postgresql
useradd web -m