Skip to content

Instantly share code, notes, and snippets.

Manuel Schmalstieg ms-studio

Block or report user

Report or block ms-studio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ms-studio
ms-studio / ffmpeg_mkv_mp4_conversion.md
Created Jun 19, 2019 — forked from jamesmacwhite/ffmpeg_mkv_mp4_conversion.md
Easy way to convert MKV to MP4 with ffmpeg
View ffmpeg_mkv_mp4_conversion.md

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

View gist:8027e39efe1c1a891419cc635220d0d4
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
View mem-category-order-plugin.php
<?php
/*
Plugin Name: MEM Category Order
Plugin URI: https://gist.github.com/
Description: Functionality plugin for https://wordpress.org/support/topic/ordering-post/.
Version: 0.1
Author: Manuel Schmalstieg
Author URI: https://ms-studio.net
*/
@ms-studio
ms-studio / WP YouTube Video EMbed Override
Created Apr 30, 2018 — forked from gabrielmerovingi/WP YouTube Video EMbed Override
Override the default WordPress oEmbed for YouTube Videos to always use the myCRED Video Shortcode.
View WP YouTube Video EMbed Override
/**
* Override WP oEmbed
* @version 1.0
*/
add_filter( 'embed_oembed_html', 'mycred_override_video_shortcode', 999, 4 );
function mycred_override_video_shortcode( $original, $url, $attr, $post_ID ) {
// If myCRED is not enabled
if ( ! function_exists( 'mycred_render_shortcode_video' ) ) return $original;
// Get cache
@ms-studio
ms-studio / improve-slideshare-embed.js
Created Dec 11, 2017
Improve Slideshare embedding - Make that iframe exactly the right size!
View improve-slideshare-embed.js
/*
* Improve Slideshare embedding
* Make that iframe exactly the right size!
*/
$(".entry-content p iframe[src*='https://www.slideshare']").each(function() {
var $this = $(this);
var slideW = $this.attr('width');
var slideH = $this.attr('height');
@ms-studio
ms-studio / vimeo-responsive-embed.js
Created Dec 11, 2017
vimeo-responsive-embed.js
View vimeo-responsive-embed.js
$(".entry-content > p > iframe").each(function() {
var $this = $(this);
// donner classe video-gallery-item au parent
$this.parent().addClass('video-gallery-item');
// corriger le ratio
var videoWidth = $this.attr('width');
var videoHeight = $this.attr('height');
var videoRatio = 100*(videoHeight / videoWidth);
$this.parent().css( "padding-bottom", videoRatio+"%" );
});
View tablepress-example.html
<script>
jQuery(document).ready(function($){
$.tablesorter.themes.bootstrap = {
// these classes are added to the table. To see other table classes available,
// look here: http://getbootstrap.com/css/#tables
table : 'table table-bordered table-striped',
caption : 'caption',
// header class names
@ms-studio
ms-studio / form_name_shortcode.php
Last active Oct 7, 2018
Shortcode for the Formidable WordPress plugin, that returns the name of the current form (based on the entry ID).
View form_name_shortcode.php
<?php
/*
* Form Name Shortcode
* For usage in confirmation email
* Returns name of current form
* Use the shortcode like this: [frm-form-name id=[id]]
* The [id] parameter will produce the ID of current entry
* See https://formidableforms.com/help-desk/using-form_name-shortcode-in-email-notification/
*/
@ms-studio
ms-studio / formidable-get-form-name.php
Last active Sep 7, 2017
With Formidable Forms, display Names of all forms a user submitted
View formidable-get-form-name.php
<?php
// For context, see discussion here:
// https://formidableforms.com/help-desk/display-all-entries-by-user-across-several-forms/
global $wpdb;
// Get IDs of all Forms the current user has submitted:
$user_forms = $wpdb->get_col( $wpdb->prepare(
View simple-git-branching-model.md

a simple git branching model

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

You can’t perform that action at this time.