Skip to content

Instantly share code, notes, and snippets.

<html>
<body>
<h1>#1591 video loop demo </h1>
<div id='buto_tCMBn'></div>
<script>
//Pure HTML5 embed (note the `delivery` parameter that's passed into the player object)
@singh1469
singh1469 / html5-player-events.html
Last active August 29, 2015 14:01
Buto HTML5 Player Listening for `play` and `ended` events
<html>
<body>
<h1>#1591 HTML5 player events demo </h1>
<div id='buto_tCMBn'></div>
<script>
//Pure HTML5 embed (note the `delivery` parameter that's passed into the player object)
<div id="buto_form" class="columns small-12 ">
<div class="buto_form_loading_gif_container">
<img class="buto_form_loading_gif" src="//s3-eu-west-1.amazonaws.com/origin.buto.tv/butotv/live/static/buto/embed_form/loading.gif" />
</div>
</div>
<script>
(function(d, conf) {
var b = d.createElement('script');
b.setAttribute('async', true);
b.src = '//embed.butolabs.tv/form/rfu2014';
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
</head>
<h3>Lukkien</h3>
<p>
<h4>Sample video</h4>
<div class="video" id="buto_12345"></div>
/**
* Simple userland heapdump generator using v8-profiler
* Usage: require('[path_to]/HeapDump').init('datadir')
*
* @module HeapDump
* @type {exports}
*/
var fs = require('fs');
var profiler = require('v8-profiler');
@singh1469
singh1469 / gist:bff9332f31876259ff8f
Last active December 16, 2015 12:09
Node stuff
`node --perf_basic_prof_only_functions`
Provides CPU stack trace of running processs without affecting process
Then use Flame graphs to visualise and indentify issues
//<Buto embed code here>
<script>
var embedElement = document.getElementById('buto_<video_id>');
embedElement.addEventListener('playerReady',function(readyEvent){
//create variable referencing the Buto player
var player = Akita.playerInstances[this.getAttribute('data-instance-id')];
//add event listener to play event
player.video.el.addEventListener('play',function(){
//<hide text code goes here>
@singh1469
singh1469 / docker-labels.md
Created April 12, 2017 08:47 — forked from leanderjanssen/docker-labels.md
Example of a Dockerfile with LABEL and ARG

Example of using LABEL and ARG in a Dockerfile

Dockerfile

FROM ubuntu:14.04
RUN apt-get -y update
RUN apt-get -y install vim
RUN apt-get -y install curl
ARG GIT_COMMIT=unknown
LABEL git-commit=$GIT_COMMIT
@singh1469
singh1469 / cert.sh
Created April 12, 2017 10:12 — forked from leanderjanssen/cert.sh
Create Docker certificates
#!/bin/bash
# Retrieve public and private ip of instance
PUBLIC_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
PRIVATE_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
mkdir ~/docker-ca
chmod 0700 ~/docker-ca
cd ~/docker-ca || exit 1
@singh1469
singh1469 / domain.sh
Created April 12, 2017 13:39 — forked from leanderjanssen/domain.sh
Create Registry Server certificate
#!/bin/bash
# Retrieve public and private ip of instance
PUBLIC_HOSTNAME=$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)
PUBLIC_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
PRIVATE_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
# Generate openssl config for self-signed certificate with SANs
cat << EOF > ~/domain.cnf
[ ca ]