(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
function keepTrying(otherArgs, promise) { | |
promise = promise||new Promise(); | |
// try doing the important thing | |
if(success) { | |
promise.resolve(result); | |
} else { | |
setTimeout(function() { | |
keepTrying(otherArgs, promise); |
# Installing tmux on Amazon-EC2 | |
# If you don't have libevent install use wget to install the libevent and install | |
wget https://github.com/downloads/libevent/libevent/libevent-2.0.18-stable.tar.gz | |
tar zxf libevent-2.0.18-stable.tar.gz | |
sudo ./configure & sudo make install | |
# If you don't have curses install use yum to install the curses |
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
upstream project { | |
server 22.22.22.2:3000; | |
server 22.22.22.3:3000; | |
server 22.22.22.5:3000; | |
} | |
server { | |
listen 80; | |
location / { |
#参考资料
###下载单个文件,默认将输出打印到标准输出中(STDOUT)中
curl http://www.centos.org
'use strict'; | |
// simple express server | |
var express = require('express'); | |
var app = express(); | |
var router = express.Router(); | |
app.use(express.static('public')); | |
app.get('/', function(req, res) { | |
res.sendfile('./public/index.html'); |
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
function Polygon(height, width) { //class constructor | |
this.name = 'Polygon'; | |
this.height = height; | |
this.width = width; | |
} | |
Polygon.prototype = { | |
sayName: function () { //class method | |
console.log('Hi, I am a ' + this.name + '.'); | |
} |
function* range(start, end, step) { | |
while (start < end) { | |
yield start; | |
start += step; | |
} | |
} | |
for (let i of range(0, 10, 2)) { | |
console.log(i); | |
} |