This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function queue(tasks, scope) { | |
| var slice = Array.prototype.slice,task, on ={}, error; | |
| function next() { | |
| if (task = tasks.shift()) { | |
| task.apply(scope, [next].concat(slice.call(arguments, 0))); | |
| }else{ | |
| on.done && on.done(); | |
| } | |
| } | |
| next.error = function(err){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Licensed to the Apache Software Foundation (ASF) under one | |
| or more contributor license agreements. See the NOTICE file | |
| distributed with this work for additional information | |
| regarding copyright ownership. The ASF licenses this file | |
| to you under the Apache License, Version 2.0 (the | |
| "License"); you may not use this file except in compliance | |
| with the License. You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var socketIO = require('socket.io'), | |
| io; | |
| // hapi plugin registration | |
| exports.register = function(plugin, options, next) { | |
| // this is the hapi specific binding | |
| io = socketIO.listen(plugin.servers[0].listener); | |
| io.sockets.on('connection', function(socket) { | |
| socket.emit({msg: 'welcome'}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var commonJs = function(src,callback){ | |
| setTimeout(function(){ | |
| callback(null,{ | |
| src:src, | |
| style:"commonJs" | |
| }); | |
| },100); | |
| } | |
| var commonJsError = function(src,err,callback){ | |
| setTimeout(function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var os = require('os'); | |
| var ifaces = os.networkInterfaces(); | |
| Object.keys(ifaces).forEach(function (ifname) { | |
| var alias = 0 | |
| ; | |
| ifaces[ifname].forEach(function (iface) { | |
| if ('IPv4' !== iface.family || iface.internal !== false) { | |
| // skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Plugin: jQuery Parallax | |
| Version 1.1.3 | |
| Author: Ian Lunn | |
| Twitter: @IanLunn | |
| Author URL: http://www.ianlunn.co.uk/ | |
| Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/ | |
| Dual licensed under the MIT and GPL licenses: | |
| http://www.opensource.org/licenses/mit-license.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * media streaming | |
| * @method streamMedia | |
| * @param {String} path file path | |
| * @param {Object} ioArgs a http connection | |
| * @param {Object} ioArgs.req request object of a http connection | |
| * @param {Object} ioArgs.res response object of a http connection | |
| * @param {Object} ioArgs.next passe to not found | |
| */ | |
| function streamMedia(path, ioArgs) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| map $http_upgrade $connection_upgrade { | |
| default upgrade; | |
| '' close; | |
| } | |
| upstream websocket { | |
| server 192.168.100.10:8010; | |
| } | |
| server { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('myApp.directives', []) | |
| .directive('captcha', function () { | |
| return { | |
| scope: { ngData: '@', ngClick: '@' }, | |
| restrict: 'A', | |
| link: function (scope, el, attrs) { | |
| var canvas = el[0]; | |
| var context = canvas.getContext("2d"); | |
| var fontsize = 14; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "parser": "babel-eslint", | |
| "env": { | |
| "browser": true, | |
| "node": true, | |
| "es6": true | |
| }, | |
| "extends": "airbnb/base", | |
| "rules": { | |
| "semi": 2, |