Skip to content

Instantly share code, notes, and snippets.

View r37r0m0d3l's full-sized avatar

Anton Trofymenko r37r0m0d3l

View GitHub Profile
@r37r0m0d3l
r37r0m0d3l / postgres-brew.md
Created May 7, 2019 19:47 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@r37r0m0d3l
r37r0m0d3l / zsh_bash_keybindings_alt-arrow_mac.sh
Created July 18, 2019 20:13 — forked from emanueljacob/zsh_bash_keybindings_alt-arrow_mac.sh
Alt + Arrow Key Bindings for JetBrains IntelliJ/PhpStorm on MacOS
# Currently the embedded terminal of Jetbrains IDEs does not make use of keybindings defined in terminal/iterm on mac
# Instead yo get the ring bell and output like [C or [D
#
# see: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000013224-Alt-key-not-working-in-embedded-terminal
#
# to fix it and allow ALT + Arrow in the the IDEs embedded terminal just do the following (depending on wich shell you use)
# If you use zsh
# Add this to ~/.zshrc :
bindkey "\e\eOD" backward-word
@r37r0m0d3l
r37r0m0d3l / README.md
Created July 30, 2019 19:06 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@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

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@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:

@r37r0m0d3l
r37r0m0d3l / plink-plonk.js
Created February 19, 2020 15:00 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@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 / 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) },
# 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