Skip to content

Instantly share code, notes, and snippets.

{
"_id": "5210c8bbee67897630000001",
"name": "tdylan",
"images": true,
"length": 0,
"addSound": true,
"items": [
{
"name": "1st clips used for BG",
"asset_id": "",
@kpnemo
kpnemo / gist:2c39c0aab72a2ee880c4
Last active August 29, 2015 14:02
Showbox iOS recorder app EVENTS
Note: Every event have in data the roomId: data{room: %roomId%}
Event Server: roomCreated, data: {room: %roomId%}
Event Server: clientConnected, data: {accessToken: %accessToken%, primary: %true%} (primary only in case if mobile device connected)
Event Web: startPreviewStream, data: {streamId: %streamId%, streamUrl: %streamUrl%}
Event Web: stopPreviewStream, data: {streamId: %streamId%}
Event Web: startRecord, data: {streamId: %streamId%, streamUrl: %streamUrl%, fileId: %fileId%}
Event Web: stopRecord, data: {fileId: %fileId%}
Event Web: abordRecord, data: {fileId: %fileId%}
@kpnemo
kpnemo / jquery.imageEnlarge.js
Last active August 29, 2015 14:04
jQuery image enlarge on click to its original size
/**
* Image enlarge on click
*/
(function( $ ){
var _settings = {
cursor: 'crosshair',
animationTime: 300,
watchResize: true
}
{
"id": "restaurant_review",
"formatName": "Come dine with me!",
"title": "Restaurant review",
"totalLength": 100,
"tags": "food, restaurant, cooking",
"transition": "fade_in",
"description": "Take us with you to explore the world of eating out. Film your favorite restaurants and visit the new and exciting ones. Show your viewers the appetizing dishes, the beautiful locations and what happens inside the kitchens of every restaurant you choose.",
"blocks": [
{
{
"id": "afd480cfcb2349c7a70e5a45045c524a",
"block_id": null,
"episode_id": "53d844fe76c5210000745b97",
"user_id": "530cf6ccc0a5eb940a45ccdc",
"state": "ready",
"pub_sub_channel": "wf:afd480cfcb2349c7a70e5a45045c524a",
"created_at": "2014-07-30 03:13:07 UTC",
"processing_started_at": "2014-07-30 03:13:07 UTC",
"ended_at": "2014-07-30 03:17:31 UTC",
root@api:/var/log# grep -e "29c26a3d47384af987a27d9d962e2d32" app-api.log
[INFO 2014-07-31 11:54:27 +0000] WFS response {"id":"29c26a3d47384af987a27d9d962e2d32","block_id":"53da09c0ff6c05544c30ffc9","episode_id":null,"user_id":"5312ea5b6e07b34c4cbe255c","state":"processing","pub_sub_channel":"wf:29c26a3d47384af987a27d9d962e2d32","created_at":"2014-07-31 11:54:27 UTC","processing_started_at":"2014-07-31 11:54:27 UTC","ended_at":null,"block":{"asset_id":null,"compiled_at":"2014-07-31T11:54:24.629Z","created_at":1406798272,"episodeId":"53da09bfff6c05544c30ffc7","included":true,"items":[{"id":"d64c43e8f0db33401547c2b2a0369b59","name":"1st clips used for BG","asset_id":null,"zindex":0,"duration":null,"order":0,"markin":0,"offset":0,"type":"virtual_set","cms_id":"VIDEO_WALL_2TV","talents":{"talent1":{"transformation":"talent.txt","markin":0,"playlist":[{"bg_asset_id":"53da2d852fd324dbdf000086","markin":0,"upload_asset_id":"53da2db32fd324fc5a000087","offset":5.407394067796609,"duration":14.902605932203386,"audio_vol
var _mergeChunks = function(id, chunksArr, callback){
var exec = require('child_process').exec,
tmpDir = config.getUploadPath(),
fileHash = crypto.createHash('md5').update(id + moment().unix()).digest('hex'),
txtFile = 'concat_' + fileHash + '_' + id + '.txt',
videoOut = 'concat_' + fileHash + '_' + id + '.mp4',
stream = fs.createWriteStream(tmpDir + '/' + txtFile),
cmd;
stream.once('open', function(fd) {
@kpnemo
kpnemo / showbox wizard generic
Last active August 29, 2015 14:06
wizard_generic.js
var wizard = new GenericWizard({
views: {
1: {
title: 'Some Title',
htmlView: 'html DOM here',
bbView: 'backbone view here optional'
},
2: {
title: 'Some Title',
htmlView: 'html DOM here',
var _ = require('lodash'),
users = require('../routes/user2'),
assets = require('../routes/assets'),
openTok = require('./opentok.wrapper'),
appEvents = require('./app_events'),
io = null,
rooms = {};
module.exports = {
sub.on('subscribe', function(channel){
console.log('SUBSCRIBED TO CH: ' + channel);
Events.emit('subscribed:' + num, channel);
});
sub.on('message', function(chanel, message){
console.log('ONMESSAGE FROM CH: ' + chanel + ' with message ' + message);
});
sub.subscribe('msg:' + num);