A Dashing widget for displaying the number of current visitors (in real time) to your website, as reported by Google Analytics.
This widget is a fork of https://gist.github.com/mtowers/5986576
/** | |
* Simple userland CPU profiler using v8-profiler | |
* Usage: require('[path_to]/CpuProfiler').init('datadir') | |
* | |
* @module CpuProfiler | |
* @type {exports} | |
*/ | |
var fs = require('fs'); | |
var profiler = require('v8-profiler'); |
/** | |
* 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'); |
var child_process = require('child_process'), | |
http = require('http'); | |
url = require('url'), | |
ffmpeg = null; | |
var livestream = function (req, resp) { | |
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible). | |
var input = 'udp://225.1.1.1:8208'; |
var webpack = require('webpack'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var path = require('path'); | |
var folders = { | |
APP: path.resolve(__dirname, '../app'), | |
BUILD: path.resolve(__dirname, '../build'), | |
BOWER: path.resolve(__dirname, '../bower_components'), | |
NPM: path.resolve(__dirname, '../node_modules') | |
}; |
{ | |
// 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 | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
A Dashing widget for displaying the number of current visitors (in real time) to your website, as reported by Google Analytics.
This widget is a fork of https://gist.github.com/mtowers/5986576
// Live video stream management for HTML5 video. Uses FFMPEG to connect to H.264 camera stream, | |
// Camera stream is remuxed to a MP4 stream for HTML5 video compatibility and segments are recorded for later playback | |
var liveStream = function (req, resp) { // handle each client request by instantiating a new FFMPEG instance | |
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible). | |
var reqUrl = url.parse(req.url, true) | |
var cameraName = typeof reqUrl.pathname === "string" ? reqUrl.pathname.substring(1) : undefined; | |
if (cameraName) { | |
try { | |
cameraName = decodeURIComponent(cameraName); |
var fs = require('fs'); | |
var request = require('request'); | |
var joinUrl = require('url').resolve; | |
if (process.argv.length != 3) { | |
console.log("Please pass playlist URL"); | |
process.exit(1); | |
} | |
var plsUrl = process.argv[2]; | |
var INTERVAL = 5 * 1000; |
/** | |
* | |
* | |
* ajax-submit 클래스 추가 시 이벤트 바인딩 (첫번째 인자가 form event 객체임에 유의.) | |
* <code> | |
* $('#form').on('ajaxbefore', function(event, jqXHR, settings)); // | |
* $('#form').on('ajaxcomplete', function(event, jqXHR, testStatus)); // | |
* $('#form').on('ajaxsuccess', function(event, responseObject, testStatus, jqXHR)); // | |
* $('#form').on('ajaxerror', function(event, jqXHR, testStatus, errorThrown)); // | |
* </code> |
The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows: