Skip to content

Instantly share code, notes, and snippets.

View ms-studio's full-sized avatar

Manuel Schmalstieg ms-studio

View GitHub Profile
@ms-studio
ms-studio / Readymag-Interaction.js
Last active October 10, 2024 09:23
Javascript that interacts with Readymag
console.log("trying to interact with Readymag...");
document.addEventListener('click', function (event) {
console.log("click intercepted!");
console.log( "click target: " + event.target );
if (event.target.matches('[data-id]')) {
// get the data-id of this
var dataID = event.target.getAttribute('data-id');
console.log(dataID);
I am attesting that this GitHub handle ms-studio is linked to the Tezos account tz1MESCCzDKugDMqwqfbn6jVLiJuZCjS7dXa for tzprofiles
sig:edsigu5w9K54rwGqqcW1MwKkr1KDjvdRzJkibK8tFZnVeNyXZM3zFgcuEHm69ZP8dkxgHs3LCH134RSnULBtdxuEaJUdG7TTk1u
@ms-studio
ms-studio / custom-properties-boilerplate.css
Created January 1, 2020 16:50 — forked from malarkey/custom-properties-boilerplate.css
CSS Custom Properties boilerplate
/* CSS Custom Properties */
:root {
--font-family: 'Georgia', serif;
--font-family-alt: 'Helvetica', Arial, sans-serif;
--font-weight: 400;
--font-weight-bold: 700;
--font-weight-black: 900;
/* 3:4 perfect fourth scale */
@ms-studio
ms-studio / ffmpeg_mkv_mp4_conversion.md
Created June 19, 2019 23:21 — 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

@ms-studio
ms-studio / gist:8027e39efe1c1a891419cc635220d0d4
Created January 8, 2019 13:38 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!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>
<?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 April 30, 2018 08:31 — forked from gabrielmerovingi/WP YouTube Video EMbed Override
Override the default WordPress oEmbed for YouTube Videos to always use the myCRED Video Shortcode.
/**
* 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 December 11, 2017 21:51
Improve Slideshare embedding - Make that iframe exactly the right size!
/*
* 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 December 11, 2017 21:13
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+"%" );
});
@ms-studio
ms-studio / tablepress-example.html
Created November 9, 2017 19:14
tablepress example
<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