Skip to content

Instantly share code, notes, and snippets.

View jeandat's full-sized avatar
😁
Coding

Jean DAT jeandat

😁
Coding
View GitHub Profile
@jeandat
jeandat / ffmpeg_mkv_mp4_conversion.md
Created December 27, 2020 21:43 — forked from jamesmacwhite/ffmpeg_mkv_mp4_conversion.md
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@jeandat
jeandat / check_open_port.md
Created May 2, 2017 20:16
Check open port
$ sudo lsof -nP -i:80
# Example: vmnet-nat 1045    root  9u  IPv4 0x8380  0t0  TCP *:80 (LISTEN)
@jeandat
jeandat / Uninstall-pkg.md
Created March 22, 2017 06:53 — forked from githubutilities/Uninstall-pkg.md
Uninstall pkg manually in OS X

Mac Uninstall pkg Manually

  • using pkgutil
# list all your installed packages
pkgutil --pkgs

# show your package info
pkgutil --pkg-info 
@jeandat
jeandat / Deploy on github pages.md
Last active March 18, 2017 01:09
Little idea to deploy a folder on the gh-pages branch automatically.

Deploy on Github Pages from a folder

  1. Create the gh-pages branch and initialize it with nothing except a .gitkeep file.

  2. Add gh-pages/ folder in .gitignore to keep git history clean.

  3. From the master branch, clone the gh-pages branch into the gh-pages folder:

@jeandat
jeandat / angular-cli+yarn.md
Last active October 25, 2020 12:26
Create a new angular project with @angular/cli and yarn

Tell ng to use yarn all the times:

$ ng set --global packageManager=yarn

Create a new angular4 project:

$ ng new myapp --ng4 --routing --style=scss

Comment avoir deux instances autonomes de Firefox utilisant chacun un profil différent

Créer un nouveau profil MyProfile depuis le gestionnaire de profil :

open -a Firefox --args -ProfileManager

Lancer firefox en utilisant ce profil :

@jeandat
jeandat / my-prompt.md
Last active January 16, 2017 14:41
My Customized Bash Prompt
# Get current git branch
function parse_git_branch () {
       git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
BLACK="\[\033[0;30m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[0;32m\]"
YELLOW="\[\033[0;33m\]"
BLUE="\[\033[0;34m\]"
@jeandat
jeandat / pre_post_hook_prompt.md
Created January 16, 2017 14:23
Pre & Post hook for bash prompt (terminal)

PRE / POST Hook for Bash Prompt

Explained here.

AT_PROMPT=1 
# This will run before any command is executed.
function PreCommand() {
  if [ -z "$AT_PROMPT" ]; then
 return
@jeandat
jeandat / ionic2-env-conf.md
Last active January 8, 2017 18:07
Allow using different configuration files in order to instrument the build

ExtendedDefinePlugin will replace ENV variables by their configuration value. Uglify will remove dead code.

1. Copy and modify webpack.config.js

// EDIT by Jean DAT
// Custom code in order to load different configuration files based on context (targeted environment).
// In a configuration file, I store things like the API url to use, etc.
var ExtendedDefinePlugin = require('extended-define-webpack-plugin');
@jeandat
jeandat / edit_plist_file.md
Created September 23, 2016 08:11
A nice way to edit an iOS plist file from the shell

A nice way to edit an iOS plist file from the shell

Source

#!/bin/bash

if [[ ! -f /usr/libexec/PlistBuddy ]]; then
    exit 0
fi