A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
| function mapValues(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| result[key] = fn(obj[key], key); | |
| return result; | |
| }, {}); | |
| } | |
| function pick(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| if (fn(obj[key])) { |
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
| // Simplified gulpfile | |
| var gulp = require('gulp'), | |
| watch = require('gulp-watch'), | |
| webpack = require('gulp-webpack-build'); | |
| var CONFIG = { | |
| paths: { | |
| build: 'build', | |
| input: { |
| //JS Client For Websockets Server | |
| //For C# Use Fleck & NetSockets | |
| //https://github.com/statianzo/Fleck | |
| //https://netsockets.codeplex.com/Wikipage?ProjectName=netsockets | |
| var ws; | |
| $(document).ready(function () { | |
| // test if the browser supports web sockets | |
| if ("WebSocket" in window) { | |
| debug("Browser supports web sockets!", 'success'); |
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
| /** | |
| Font.js v2012.01.25 | |
| (c) Mike "Pomax" Kamermans, 2012 | |
| Licensed under MIT ("expat" flavour) license. | |
| Hosted on http://github.com/Pomax/Font.js | |
| This library adds Font objects to the general pool | |
| of available JavaScript objects, so that you can load | |
| fonts through a JavaScript object similar to loading |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>| /* | |
| In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
| server, but for some reason omit a client connecting to it. I added an | |
| example at the bottom. | |
| Save the following server in example.js: | |
| */ | |
| var net = require('net'); |