(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.
(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.
| #!/bin/sh | |
| # Run the vagrant command for a particular project from anywhere. | |
| # | |
| # To use: | |
| # 1. Put this file in ~/bin/ or some other executable path (also make sure the | |
| # file is executable). | |
| # 2. Insert the path to the directory containing your project's Vagrantfile | |
| # where indicated below. | |
| # 3. Rename this file to match the project you're using it for. |
| echo "This is our provisioning script" | |
| apt-get update | |
| apt-get install -y python-software-properties python g++ make | |
| add-apt-repository ppa:chris-lea/node.js | |
| apt-get update | |
| apt-get install -y nodejs | |
| npm install -g grunt-cli |
| #!/usr/bin/env bash | |
| set -u | |
| set -e | |
| export GIT_WORK_TREE="/var/www/example.com" | |
| export NODE_VERSION="0.10" | |
| echo "--> Checking out..." | |
| git checkout -f |
| upstream node_backend { | |
| server 127.0.0.1:3000; | |
| keepalive 32; | |
| } | |
| server { | |
| root /var/www/testapp/public; | |
| index index.html; |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| var exec = require('child_process').exec; | |
| var fs = require('fs'); | |
| var util = require('util'); | |
| var http = require('http'); | |
| var url = require('url'); | |
| var PDFDocument = require('pdfkit'); // http://pdfkit.org/ | |
| http.createServer(function (req, res) { |
| function slugify(text) | |
| { | |
| return text && text.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
| .replace(/\-\-+/g, '-') // Replace multiple - with single - | |
| .replace(/^-+/, '') // Trim - from start of text | |
| .replace(/-+$/, '') // Trim - from end of text | |
| || text; | |
| } |