Setup LAMP server
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
| # Shell prompt based on the Solarized Dark theme. | |
| # Screenshot: http://i.imgur.com/EkEtphC.png | |
| # Heavily inspired by @necolas’s prompt: https://github.com/necolas/dotfiles | |
| # iTerm → Profiles → Text → use 13pt Monaco with 1.1 vertical spacing. | |
| if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then | |
| export TERM='gnome-256color'; | |
| elif infocmp xterm-256color >/dev/null 2>&1; then | |
| export TERM='xterm-256color'; | |
| fi; |
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
| /** | |
| * Generates number of random geolocation points given a center and a radius. | |
| * @param {Object} center A JS object with lat and lng attributes. | |
| * @param {number} radius Radius in meters. | |
| * @param {number} count Number of points to generate. | |
| * @return {array} Array of Objects with lat and lng attributes. | |
| */ | |
| function generateRandomPoints(center, radius, count) { | |
| var points = []; | |
| for (var i=0; i<count; i++) { |
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
| class XForwardedPort(object): | |
| def process_request(self, request): | |
| try: | |
| request.META['SERVER_PORT'] = request.META['HTTP_X_FORWARDED_PORT'] | |
| except KeyError: | |
| pass | |
| return None |
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
| #!/bin/sh | |
| # Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh | |
| set -e | |
| # Must be a valid filename | |
| NAME=foo | |
| PIDFILE=/var/run/$NAME.pid | |
| #This is the command to be run, give the full pathname | |
| DAEMON=/usr/local/bin/bar |