Skip to content

Instantly share code, notes, and snippets.

View pupunzi's full-sized avatar

Pupunzi pupunzi

View GitHub Profile
@pupunzi
pupunzi / mb-block.js
Last active June 26, 2021 23:39
A simple Wordpress Gutenberg plug-in
/**
* mb Gutemberg block
* Copyright (c) 2001-2018. Matteo Bicocchi (Pupunzi)
*/
var el = wp.element.createElement,
registerBlockType = wp.blocks.registerBlockType,
ServerSideRender = wp.components.ServerSideRender,
TextControl = wp.components.TextControl,
TextareaControl = wp.components.TextareaControl,
InspectorControls = wp.editor.InspectorControls;
@pupunzi
pupunzi / YTPlayer-random-video
Last active November 26, 2015 18:55
Random YTPlayer video
<script>
var videos = ["VuaJAgx0x_4", "3ovA7zeviRo", "u9k1FaMIYTs", "bkCg84XgBUg", "UJQmV8aPNao"];
var rndVideo = videos[Math.floor(Math.random() * videos.length)];
</script>
<div class="player" data-property="{videoURL:rndVideo,containment:'body',autoPlay:true, mute:true, startAt:0,opacity:1,ratio:'4/3', addRaster:true}">My video</div>
@pupunzi
pupunzi / index.html
Last active August 29, 2015 14:21
ytube vid test// source http://jsbin.com/jolocipalo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ytube vid test</title>
<link href="https://rawgit.com/pupunzi/jquery.mb.YTPlayer/master/css/YTPlayer.css" media="all" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://rawgit.com/pupunzi/jquery.mb.YTPlayer/master/inc/jquery.mb.YTPlayer.min.js"></script>