A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
This file contains 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
const findOrCreate = require('./hook.find-or-create.js') | |
app.service('messages').hooks({ | |
before: { | |
create: [findOrCreate()] | |
} | |
}) |
This file contains 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
import { AsyncStorage } from 'react-native'; | |
import feathers from 'feathers/client' | |
import hooks from 'feathers-hooks'; | |
import socketio from 'feathers-socketio/client' | |
import authentication from 'feathers-authentication-client'; | |
if(!global._babelPolyfill) { require('babel-polyfill'); } | |
// Need to require instead of import so we can set the user agent first | |
const io = require('socket.io-client/socket.io'); |
This file contains 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
// You need to set `window.navigator` to something in order to use the socket.io | |
// client. You have to do it like this in order to use the debugger because the | |
// debugger in React Native runs in a webworker and only has a getter method for | |
// `window.navigator`. | |
window.navigator.userAgent = 'ReactNative'; | |
// Need to require instead of import so we can set the user agent first | |
// This must be below your `window.navigator` hack above | |
const io = require('socket.io-client/socket.io'); | |
const socket = io('http://chat.feathersjs.com', { |
This file contains 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
'use strict'; | |
import React, { | |
AppRegistry, | |
Component, | |
StyleSheet, | |
Text, | |
View, | |
TouchableOpacity, | |
LayoutAnimation, | |
} from 'react-native'; |
This example show how-to setup a very simple Swarm cluster enabled with Weave Net.
## Infratructure
There are two hosts that have a recent version of Docker Engine running.
These hosts are named host1
and host2
, and might have the following in
/etc/hosts
or you just substitute IP addresses in the commands shown below.
This file contains 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
{ | |
"id": "marathon-lb-autoscale", | |
"args":[ | |
"--marathon", "http://leader.mesos:8080", | |
"--haproxy", "http://marathon-lb.marathon.mesos:9090", | |
"--target-rps", "100", | |
"--apps", "nginx_10000" | |
], | |
"cpus": 0.1, | |
"mem": 16.0, |
This file contains 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 request = require('request'); | |
var genericMultiWorker = require('./genericmultiworker.js'); | |
var TARGET_URL = 'http://example.com/'; | |
// Example: POSTing to a URL with a maximum of 5 concurrent requests | |
var addToWorker = genericMultiWorker(5, function(obj, callback) { | |
request.post(TARGET_URL, obj, callback); | |
}); |
This file contains 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
--compilers js:./test/support/compiler | |
--require ./test/support/init |
This file contains 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
// | |
// UIApplication+Debug.m | |
// | |
// Created by valvoline on 09/10/15. | |
// Copyright © 2015 ISALabs. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIApplication (Debug) |