Skip to content

Instantly share code, notes, and snippets.

View r37r0m0d3l's full-sized avatar

Anton 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
@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");
@r37r0m0d3l
r37r0m0d3l / plink-plonk.js
Created February 19, 2020 15:00 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@r37r0m0d3l
r37r0m0d3l / ffmpeg.md
Created January 26, 2020 19:24 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@r37r0m0d3l
r37r0m0d3l / gist:6da9dca2df5f50ea5f48d8b9bf74be2d
Created August 12, 2019 09:29 — forked from humbertodias/gist:e44b9413f22e3990118306f189cbbf45
Docker for Windows - Hardware assisted virtualization and data execution protection must be enabled in the BIOS
Hardware assisted virtualization and data execution protection must be enabled in the BIOS
http://stackoverflow.com/questions/39684974/docker-for-windows-error-hardware-assisted-virtualization-and-data-execution-p
If the features described are enabled the problem is with Hyper-V that is disabled or Hypervisor agent not running
Open PowerShell as administrator and
a) Enable Hyper-V with