Skip to content

Instantly share code, notes, and snippets.

View r37r0m0d3l's full-sized avatar

Anton `Myron` Trofymenko r37r0m0d3l

View GitHub Profile
@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
@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 / 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 / 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 / download_egghead_videos.md
Created March 30, 2019 23:08 — forked from ldong/download_egghead_videos.md
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});
@r37r0m0d3l
r37r0m0d3l / install consolas on os x with one command
Created March 6, 2019 18:43 — forked from piperswe/ install consolas on os x with one command
Install Consolas on OS X (based on avalonalex/8125197)
Thanks to this Gist: https://gist.github.com/avalonalex/8125197
How to use: Make sure Homebrew is installed then run `curl https://gist.githubusercontent.com/zebMcCorkle/fa4508e27f457d7b796ffd474be35d62/raw/59942466b13fe92d09b4b537cc7fcfb309c05c4a/consolas.sh | bash -`
async function getFullPost(){
return await Promise.all([
fetch('/post'),
fetch('/comments')
]);
}
const [post, comments] = getFullPost();
let param1 = 1;
let param2 = 2;
//swap and assign param1 & param2 each others values
[param1, param2] = [param2, param1];
console.log(param1) // 2
console.log(param2) // 1