Skip to content

Instantly share code, notes, and snippets.

anand-k-p /
Created Nov 5, 2020 — forked from wojteklu/
Summary of 'Clean code' by Robert C. Martin

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.

General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

anand-k-p / MongoDB Admin and User
Last active Oct 27, 2020 — forked from lgarner/MongoDB Admin and User Creation.txt
MongoDB admin and database user and role creation
View MongoDB Admin and User
anand-k-p /
Last active Mar 15, 2021 — forked from fntlnz/
Self Signed Certificate with Custom Root CA for use with DNS/Domain Names AND IP addresses for Local Development
anand-k-p /
Last active Sep 30, 2020
Postfix+PHP+Drupal on OSX 10.11.11 (El Capitan) for Software Developers (a.k.a software development and testing).

How to get mail sending to work on OSX for development purposes ONLY.

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/ 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:

  1. How to send emails from localhost (MAC OS X El Capitan)
anand-k-p /
Created Jan 7, 2016 — forked from nichtich/
How to automatically deploy from GitHub

Deploy your site with git

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 be apache on other systems)
View default.vcl
#varnish cache server configuration file, used with drupal 6 and --apache-- nginx
#inspiration from
#with change from obj to beresp of
#and cache HIT or MISS header from somewhere else
backend default {
.host = "";
.port = "8080";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
View .zshrc
# Path to your oh-my-zsh configuration.
# 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.
# Example aliases
View anand.zsh-theme
autoload -U 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_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
anand-k-p / compile-on-ubuntu_apache.html
Last active Aug 29, 2015
Compiling on Ubuntu from Scratch: Apache
View compile-on-ubuntu_apache.html
body {
color: #444;
font-size: 1.1em;
margin: 0 auto;
text-align: left;
max-width: 75%;
padding: 0 10px;
font-family: Georgia, "Times New Roman", serif; }
anand-k-p /
Created Mar 26, 2014
Enable SSH Tunnel for a connection in Heidi SQL using PLink.exe from PuTTY