Skip to content

Instantly share code, notes, and snippets.

View r37r0m0d3l's full-sized avatar

Anton `Myron` Trofymenko r37r0m0d3l

View GitHub Profile
@r37r0m0d3l
r37r0m0d3l / docker-compose.yml
Created May 22, 2020 10:42 — forked from louisbl/docker-compose.yml
docker-compose with db persistence
data:
image: debian:jessie
user: www-data
volumes:
- ./src:/var/www/
web:
image: php:5.6-apache
links:
- db
function verboseRegExp(input) {
if (input.raw.length !== 1) {
throw Error('verboseRegExp: interpolation is not supported');
}
let source = input.raw[0];
let regexp = /(?<!\\)\s|[/][/].*|[/][*][\s\S]*[*][/]/g;
let result = source.replace(regexp, '');
@r37r0m0d3l
r37r0m0d3l / class_decorator.ts
Created April 20, 2020 22:52 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
# git clone https://github.com/NVlabs/stylegan2
import os
import numpy as np
from scipy.interpolate import interp1d
from scipy.io import wavfile
import matplotlib.pyplot as plt
import PIL.Image
import moviepy.editor
import dnnlib
const factorial = (n) => {
const next = n <= 1 ? () => n * 1 : () => n * factorial(n - 1);
return next();
};
class Parent {
constructor() {
if (new.target === Parent) {
console.log("This is parent class");
}
else {
console.log("This is extended child class");
}
}
}
@r37r0m0d3l
r37r0m0d3l / morgan.nestjs.middleware.ts
Created April 10, 2020 11:03 — forked from cyril-lakech/morgan.nestjs.middleware.ts
Simplest Morgan NestJS Middleware
import { Injectable, MiddlewareFunction, NestMiddleware } from '@nestjs/common';
import * as morgan from 'morgan';
import { LoggerService } from './mylogger';
@Injectable()
export class MorganMiddleware implements NestMiddleware {
constructor(private readonly logger: LoggerService) {}
resolve(): MiddlewareFunction {
return morgan('combined', {
stream: { write: str => this.logger.info(str) },
@r37r0m0d3l
r37r0m0d3l / example.js
Created March 21, 2020 19:37 — forked from Juriy/example.js
This is an example for Node.js Boot Camp training for EPAM Systems. Day 1.
// ESC[#A moves cursor up # lines
// ESC[#B moves cursor down # lines
// ESC[#C moves cursor right # spaces
// ESC[#D moves cursor left # spaces
// Script can be written as is
process.stdout.write("\u001b[2J\u001b[0;0H");
process.stdout.write("\u001b[0;30m");
process.stdout.write("Hello there\n");

Keybase proof

I hereby claim:

  • I am r37r0m0d3l on github.
  • I am r37r0m0d3l (https://keybase.io/r37r0m0d3l) on keybase.
  • I have a public key ASCXNlJUnJroBOrwAqnUFgfzNVRmIt1W2Bce89aW
@r37r0m0d3l
r37r0m0d3l / plink-plonk.js
Created February 19, 2020 15:00 — forked from tomhicks/plink-plonk.js
Listen to your web pages