Skip to content

Instantly share code, notes, and snippets.

@dimified
dimified / .eslintrc
Last active August 29, 2015 14:25
Eslint configuration template (.eslintrc)
// .eslintrc
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
@dimified
dimified / server.js
Last active March 2, 2016 09:58
Simple HTTP server
var http = require('http'),
dispatcher = require('httpdispatcher'),
PORT = 3000;
dispatcher.onGet('/', function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Server running');
});
dispatcher.onGet('/json', function (req, res) {
@dimified
dimified / kongcat.coffee
Created April 16, 2016 15:40
Module: Kongcat (Lightweight framework for localStorage objects)
'use strict'
define [
'jquery'
'angular'
], ($, Angular) ->
###*
# Registry of module kongcat
# @namespace App.kongcat
@dimified
dimified / messageService.coffee
Created April 16, 2016 15:42
Service: Messaging (Service for handling messages)
'use strict'
define [
'jquery'
'angular'
], ($, Angular) ->
###*
# Registry of message service
# @namespace App.services.messageSrvc
@dimified
dimified / burningHoursService.coffee
Created April 16, 2016 15:43
Service: BurningHours (Calculating burning hours related to ecoCalcLight project)
'use strict'
define [
'jquery'
'angular'
], ($, Angular) ->
###*
# Registry of burning hours service
# @namespace App.services.burningHoursSrvc
'use strict'
define [
'jquery'
'angular'
], ($, Angular) ->
###*
# Registry of directives
@dimified
dimified / unit.spec.coffee
Last active April 18, 2016 22:39
Unit Tests
### global Foundation:false ###
'use strict'
define [
'jquery'
'app'
'angular'
'angular.mocks'
@dimified
dimified / e2e.spec.coffee
Created April 18, 2016 22:38
E2E tests
'use strict'
hasClass = (element, cls) ->
return element.getAttribute('class').then (classes) ->
return classes.split(' ').indexOf(cls) != -1
browser.driver.manage().window().setSize(1024, 768)
describe 'App featuring', () ->
describe 'header', () ->
@dimified
dimified / addStreamEventListener.js
Created October 23, 2016 14:48
Stream event listener (HbbTV 2.0)
/**
* Stream event callback
*/
const callback = (e) => {
if (e.status === 'trigger') {
if (Playlist[e.text]) { // globally defined playlist
_currentAd = this.view.showAd(Playlist[e.text]); // saving in the context of Controller
}
}
};
@dimified
dimified / streamEvent.xml
Created October 23, 2016 14:48
Stream Event
<?xml version="1.0" encoding="utf-8"?>
<dsmcc xmlns="urn:dvb:mis:dsmcc:2009" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:dvb:mis:dsmcc:2009 file:stream_event.xsd">
<dsmcc:dsmcc_object xmlns:dsmcc="urn:dvb:mis:dsmcc:2009" dsmcc:component_tag="101">
<dsmcc:stream_event dsmcc:stream_event_id="1" dsmcc:stream_event_name="pro7" /></dsmcc:dsmcc_object>
</dsmcc>