Skip to content

Instantly share code, notes, and snippets.

View Palatnyi's full-sized avatar
🐏
Out sick

Andrew Palatnyi

🐏
Out sick
View GitHub Profile
import 'dart:async';
import 'dart:io';
import 'dart:isolate';
import 'package:random_string/random_string.dart';
Isolate isolate;
main() {
print("running dart program");
createNewIsolate();
@Palatnyi
Palatnyi / index.ts
Created January 7, 2020 10:09
expressjs-extend-req-object
declare namespace Express {
export interface Request {
user: {
name: string,
surname: string,
age: number
}
}
}
@Palatnyi
Palatnyi / server.ts
Last active January 12, 2020 13:40
server.ts
import express, { Application, RequestHandler, Request, Response } from "express";
const app: Application = express();
const alwaysRespondWithHelloWorld: RequestHandler = (req: Request, res: Response) => {
res.send('hello world');
};
app.use(alwaysRespondWithHelloWorld)
const alwaysRespondWithHelloWorld: RequestHandler = (req: Request, res: Response) => {
req.user = {
name: 'Andrew',
surname: 'Palatnyi',
age: 27
};
res.send('hello world');
};
//alert for operator and drone
{
alertId: '123',
detections: [{
positions: [ {},{} ]
detectionType: 'remote'
detectionId: 9977
}, {
positions: [ {}, {} ]