(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.
| sudo tar -C /usr/local --strip-components 1 -xvf node-v4.1.0-linux-x64.tar.gz |
| app.get(/(.*\.pdf)\/([0-9]+).png$/i, function (req, res) { | |
| var pdfPath = req.params[0]; | |
| var pageNumber = req.params[1]; | |
| var PDFImage = require("pdf-image").PDFImage; | |
| var pdfImage = new PDFImage(pdfPath); | |
| pdfImage.convertPage(pageNumber).then(function (imagePath) { | |
| res.sendFile(imagePath); | |
| }, function (err) { |
| ; Global settings for redshift | |
| [redshift] | |
| ; Set the day and night screen temperatures | |
| temp-day=5700 | |
| temp-night=3500 | |
| ; Enable/Disable a smooth transition between day and night | |
| ; 0 will cause a direct change from day to night screen temperature. | |
| ; 1 will gradually increase or decrease the screen temperature. | |
| transition=1 |
| # For more information on configuration, see: | |
| # * Official English Documentation: http://nginx.org/en/docs/ | |
| # * Official Russian Documentation: http://nginx.org/ru/docs/ | |
| user nginx; | |
| worker_processes auto; | |
| error_log /var/log/nginx/error.log; | |
| #error_log /var/log/nginx/error.log notice; | |
| #error_log /var/log/nginx/error.log info; |
| pid logs/nginx.pid; | |
| error_log logs/nginx-main_error.log debug; | |
| # Development Mode | |
| master_process off; | |
| daemon off; | |
| worker_rlimit_core 2500M; | |
| working_directory /tmp; | |
| debug_points abort; | |
| env MOCKEAGAIN_VERBOSE; |
| server { listen 80; | |
| server_name example.com; | |
| access_log /var/log/example.com/nginx.access.log; | |
| error_log /var/log/example.com/nginx.error.log; | |
| root /var/www/apps/example.com/public; | |
| charset utf-8; | |
| location / { | |
| rewrite ^ https://$host$request_uri? permanent; | |
| } |
(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.
| -- Standard awesome library | |
| require("awful") | |
| require("awful.autofocus") | |
| require("awful.rules") | |
| -- Theme handling library | |
| require("beautiful") | |
| -- Notification library | |
| require("naughty") | |
| -- Load Debian menu entries | |
| require("debian.menu") |
| var orm = appRequire('orm'); | |
| var _ = require('lodash'); | |
| var db = orm.table; | |
| module.exports = function(teteris) { | |
| teteris('socialAuth').on('error', (e) => { | |
| console.log('WORKER ERROR', e); | |
| }); |
ES6 (also known as Harmony) is the the next version of Javascript. Here's a few of the additions.
A Pen by Rahul Gaur on CodePen.