Requirements:
If you're on OSX you're probably best off using Homebrew to install this stuff:
$ brew install node mongodb
Usage:
| <?php | |
| /* | |
| Plugin Name: WP_Rewrite endpoints demo | |
| Description: A plugin giving example usage of the WP_Rewrite endpoint API | |
| Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/ | |
| Author: Jon Cave | |
| Author URI: http://joncave.co.uk/ | |
| */ | |
| function makeplugins_endpoints_add_endpoint() { |
| // A very basic web server in node.js | |
| // Stolen from: Node.js for Front-End Developers by Garann Means (p. 9-10) | |
| var port = 8000; | |
| var serverUrl = "127.0.0.1"; | |
| var http = require("http"); | |
| var path = require("path"); | |
| var fs = require("fs"); | |
| var checkMimeType = true; |
MacOSX has a truly global path setting that precedes any other setting like ~/.bash_profile.
The file /private/etc/paths is a list of pathnames. The order from top to bottom defines the resulting order in the $PATH variable.
After loading /private/etc/paths there is a directory /private/etc/paths.d/ with files in the same style. Those are appended to the $PATH variable.
The default content of /private/etc/paths looks like this:
/usr/bin/bin
| /* | |
| * This work is free. You can redistribute it and/or modify it under the | |
| * terms of the Do What The Fuck You Want To Public License, Version 2, | |
| * as published by Sam Hocevar. See the COPYING file for more details. | |
| */ | |
| /* | |
| * Easing Functions - inspired from http://gizma.com/easing/ | |
| * only considering the t value for the range [0, 1] => [0, 1] | |
| */ | |
| EasingFunctions = { |
| { | |
| // Sets the colors used within the text area | |
| "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
| // Note that the font_face and font_size are overriden in the platform | |
| // specific settings file, for example, "Base File (Linux).sublime-settings". | |
| // Because of this, setting them here will have no effect: you must set them | |
| // in your User File Preferences. | |
| "font_face": "Monaco", | |
| "font_size": 12, |
| preferred_syntax = :sass | |
| http_path = '/' | |
| css_dir = 'assets/stylesheets' | |
| sass_dir = 'assets/sass' | |
| images_dir = 'assets/images' | |
| javascripts_dir = 'assets/javascripts' | |
| relative_assets = true | |
| line_comments = true | |
| # output_style = :compressed |