Skip to content

Instantly share code, notes, and snippets.

View dmk1111's full-sized avatar
🐢
Working

Dmytro Holysh dmk1111

🐢
Working
View GitHub Profile
import { AutofillMonitor } from '@angular/cdk/text-field';
import { Directive, ElementRef, Optional, Self } from '@angular/core';
import {
AbstractControl,
DefaultValueAccessor,
RequiredValidator,
Validators,
} from '@angular/forms';
/**
@dmk1111
dmk1111 / native_js_drag_and_drop_helper.js
Created December 1, 2020 15:17 — forked from druska/native_js_drag_and_drop_helper.js
Create the `simulateDragDrop` function which can be used to simulate clicking and dragging one DOM Node onto another
function simulateDragDrop(sourceNode, destinationNode) {
var EVENT_TYPES = {
DRAG_END: 'dragend',
DRAG_START: 'dragstart',
DROP: 'drop'
}
function createCustomEvent(type) {
var event = new CustomEvent("CustomEvent")
event.initCustomEvent(type, true, true, null)

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@dmk1111
dmk1111 / FFMPEG compilation.MD
Last active March 4, 2022 08:12
Install ffmpeg with all options on (Mac OS)

Originally taken from https://gist.github.com/Piasy/b5dfd5c048eb69d1b91719988c0325d8?permalink_comment_id=3314991#gistcomment-3314991

Only way I managed to install it was to compile it myself. Any other way I would only keep getting a recursive dependency error, with ChromaPrint requiring FFmpeg and FFmpeg requiring ChromaPrint.

# start clean. make sure you have xcode installed and all the other basics such as brew.
brew uninstall --force ffmpeg chromaprint amiaopensource/amiaos/decklinksdk

# installs ffmpeg vanilla as dependency
brew install chromaprint amiaopensource/amiaos/decklinksdk
  1. Install ffmpeg:
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid

(code above is outdated, foolow instructions at https://gist.github.com/dmk1111/a92a2e8ec4187d921e5c4bb6d5cee7ee)

  1. Convert:
ffmpeg -i input-file.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis output-file.webm