Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
https://www.mongodb.org/downloads
Or the apt repo based tutorial here for Ubuntu: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
MongoDB should match the python pymongo where possible to avoid version mismatch problems.
Take note about updating the mongod.conf file to a non-local host IP if doing db replication.
OSX comes with Postfix pre-installed. All that needs to be done is to configure it AND PHP. There are a couple of configuration files involved. Each file that needs to be adjusted is attached to this gist along with the relevant configuration options and settings.
You will start by editing the Postfix config file located at: /private/etc/postfix/main.cf
.
You will then edit your PHP config file (php.ini) which, for me I installed via macports and was thus located at: /opt/local/etc/php56/php.ini
.
These are the two pages that I used to get things working:
- have PuTTY installed
- make sure you have installed PLink as a part of the installation process.
- open an elevated command prompt
- run the following command
plink.exe -L 3307:localhost:3306 [USERNAME]@[YOURSERVER.COM]
This gist assumes:
- you have an online remote repository (github / bitbucket etc.)
- you have a local git repo
- and a cloud server (Rackspace cloud / Amazon EC2 etc)
- your (PHP) scripts are served from /var/www/html/
- your webpages are executed by Apache
- the Apache user is named
www-data
(may beapache
on other systems)
- make changes then make patch BEFORE COMMITTING CHANGES
$ git diff > [project-name]-[project-version].[description].[issue-number]-[comment-number].patch
- doesn't work when adding or deleting files
- you've made changes that INCLUDE adding/deleting files, BUT NOT COMMITTED
$ git [add|rm] ...
#varnish cache server configuration file, used with drupal 6 and --apache-- nginx | |
#inspiration from https://wiki.fourkitchens.com/display/PF/Configure+Varnish+for+Pressflow | |
#with change from obj to beresp of | |
#http://www.mail-archive.com/varnish-misc@projects.linpro.no/msg02911.html | |
#and cache HIT or MISS header from somewhere else | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
.connect_timeout = 600s; | |
.first_byte_timeout = 600s; |
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="anand" | |
# Example aliases |
autoload -U promptinit | |
promptinit | |
PROMPT='%{$fg_bold[yellow]%}%n%{$fg_no_bold[white]%}@%{$fg_no_bold[green]%}%m %{$fg_bold[yellow]%}%~ %{$fg_no_bold[blue]%}$(git_prompt_info)%{$fg_no_bold[blue]%} | |
%{$fg_bold[yellow]%}%(#,#,$)%{$reset_color%} ' | |
ZSH_THEME_GIT_PROMPT_PREFIX=" | |
git:(%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" |