OS | Command | Meaning |
---|---|---|
Ubuntu | `netstat -punta | grep ` |
Mac OS | `lsof -i | grep LISTEN` |
// Promise.all is good for executing many promises at once | |
Promise.all([ | |
promise1, | |
promise2 | |
]); | |
// Promise.resolve is good for wrapping synchronous code | |
Promise.resolve().then(function () { | |
if (somethingIsNotRight()) { | |
throw new Error("I will be rejected asynchronously!"); |
module.exports = function (shipit) { | |
require('shipit-deploy')(shipit); | |
shipit.initConfig({ | |
default: { | |
workspace: '../shipit-temp-folder', | |
deployTo: '~/express4-es6', | |
branch: "shipit", | |
repositoryUrl: 'https://github.com/khanghoang/express4-es6.git', | |
ignores: ['.git', 'node_modules'], |
##Get started ###On local
- Install
shipit
&shipit-deploy
- Add
shipitfile.js
- Run
ssh-add /path/to/pem/file
###Errors
####node: not found
Apparently Debian has renamed the command node to nodejs which is causing the problem. For me installing nodejs-legacy fixed the issue.
To fix:
@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).
Here we go with the explanations:
(function(x, f = () => x) {
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
##ES6 features
###Symbol
#####Another primary type
Among undefined
, Null
, Boolean
, Number
, String
, Object
#####To represent of concepts.
- As property keys.
Example:javascript
const MY_KEY = Symbol(); let obj = {};
##GitLab + Jenkins + Auto Deployment.
###Install GitLab
Follow GitLab installation guide
Or via IAM EC2 but it's ver7.x so you would update it to get GitLab CI.
https://about.gitlab.com/upgrade-to-package-repository/
####Install gitlab-ci-runner
https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/linux-repository.md
####Gitlab Config file
export class EnumSymbol { | |
sym = Symbol.for(name); | |
value: number; | |
description: string; | |
constructor(name: string, {value, description}) { | |
if(!Object.is(value, undefined)) this.value = value; | |
if(description) this.description = description; |