| Version | Link |
|---|---|
| ECMAScript 2015 - ES2015 - ES6 | All Features List |
| ECMAScript 2016 - ES2016 - ES7 | All Features List |
| ECMAScript 2017 - ES2017 - "ES8" | All Features List |
| ECMAScript 2018 - ES2018 - "ES9" | All Features List |
| ECMAScript 2019 - ES2019 - "ES10" | All Features List |
| ECMAScript 2020 - ES2020 - "ES11" | All Features List |
This file contains hidden or 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
| # Fortement inspiré de cet article: http://rabexc.org/posts/docker-networking | |
| # Tester les performances réseaux de ses conteneurs docker | |
| # avec docker-proxy | |
| docker run -it --rm --name=iperf3-server -p 10000:5201 networkstatic/iperf3 -s | |
| docker inspect --format "{{ .NetworkSettings.IPAddress }}" iperf3-server | |
| iperf3 -c 172.17.0.2 ⇒ 37gbs | |
| iperf3 -c localhost -p 10000 | |
| # désactiver docker-proxy | |
| vi /etc/docker/daemon.json |
This file contains hidden or 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
| if [[ $UID != 0 ]]; then | |
| echo "Please run this script with sudo:" | |
| echo "sudo bash $0" | |
| exit 1 | |
| fi | |
| CODE_URL=https://az764295.vo.msecnd.net/stable/19222cdc84ce72202478ba1cec5cb557b71163de/code_1.12.2-1494422229_amd64.deb | |
| CHROME_URL=https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
| GITKRAKEN_URL=https://release.gitkraken.com/linux/gitkraken-amd64.deb |
This file contains hidden or 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 mongoose = require('mongoose') | |
| , Schema = mongoose.Schema | |
| , crypto = require('crypto') | |
| /** | |
| * User Schema | |
| */ | |
| var UserSchema = new Schema({ | |
| createdAt: { type: Date, default: Date.now, required: true }, |
This file contains hidden or 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
| exports.addCarPhoto = function(req, res) { | |
| var userID = req.user._id; | |
| var carsBaseURI = "http://sobrioapp.blob.core.windows.net/cars/"; | |
| // setup photo meta data | |
| var type = req.files.photo.type; | |
| var filename = req.params.id + "-" + req.files.photo.name; | |
| var path = req.files.photo.path; |
This file contains hidden or 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
| module.exports = { | |
| development: { | |
| root: require('path').normalize(__dirname + '/..'), | |
| app: { | |
| name: 'AppName Development', | |
| nodefly: 'AppName Dev', | |
| iosversion: "2.0.0", | |
| androidversion: "0.6.0" | |
| }, | |
| db: 'mongodb://localhost/appdev', |
This file contains hidden or 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
| // Load configurations | |
| var env = process.env.NODE_ENV || 'development' | |
| , config = require('./config/config')[env]; | |
| // Bootstrap db connection | |
| mongoose.connect(config.db); | |
| relations.use(relations.stores.redis, {client: redis.createClient(config.redis.port, config.redis.host)}); | |
| // Setup App Version |
This file contains hidden or 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 nconf = require('nconf'); | |
| var ldap = require('ldapjs'); | |
| var async = require('async'); | |
| ldap.Attribute.settings.guid_format = ldap.GUID_FORMAT_D; | |
| var Users = module.exports = function(){ | |
| var options = this._options = { | |
| url: process.env["LDAP_URL"], | |
| base: process.env["LDAP_BASE"], | |
| bindDN: process.env["LDAP_BIND_USER"], |
This file contains hidden or 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 WebSocketServer = require('ws').Server; | |
| var wss = new WebSocketServer({port: 8080}); | |
| var jwt = require('jsonwebtoken'); | |
| /** | |
| The way I like to work with 'ws' is to convert everything to an event if possible. | |
| **/ | |
| function toEvent (message) { | |
| try { |
This file contains hidden or 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
| function onlyStatic (middleware) { | |
| return function (req, res, next) { | |
| var match = /(\.css|\.eot|\.gif|\.html|\.js|\.png|\.svg|\.ttf|\.woff|\.jpg)($|\?.*$)/ig.exec(req.originalUrl); | |
| if (!match) return next(); | |
| middleware(req, res, next); | |
| }; | |
| } | |
| //usage | |
| this.use(onlyStatic(express.static(__dirname + "/public"))); |
NewerOlder