Skip to content

Instantly share code, notes, and snippets.

View nirajkvinit's full-sized avatar

Niraj Kumar nirajkvinit

View GitHub Profile
@wojteklu
wojteklu / clean_code.md
Last active May 19, 2024 03:34
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

#installation
sudo apt-get update
sudo apt-get install -y apache2 libapache2-mod-php5 unzip mysql-server libapache2-mod-auth-mysql php5-mysql php5-intl mcrypt php5-mcrypt
sudo a2enmod php5
sudo php5enmod mcrypt
sudo apt-get install php5-imap
sudo php5enmod imap
cd /tmp/
@IamAdiSri
IamAdiSri / Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Last active May 9, 2022 22:08 — forked from evansneath/Python3 Virtualenv Setup
Setting up and using Python3, Pip3, Virtualenv (for Python3) and Virtualenvwrapper (for Python3)
First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py
$ cd <download location>
$ sudo -H python ./get-pip.py
Installing pip also installs Python3
To run Python3
$ python3
Install pip3 by just executing the same file as in the step above, but this time using Python3
$ sudo -H python3 ./get-pip.py
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active May 19, 2024 07:15
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@gmazzap
gmazzap / Controller.php
Last active April 22, 2024 12:08
WordPress plugin to ease the creation of virtual pages.
<?php
namespace GM\VirtualPages;
/**
* @author Giuseppe Mazzapica <giuseppe.mazzapica@gmail.com>
* @license http://opensource.org/licenses/MIT MIT
*/
class Controller implements ControllerInterface {
private $pages;
@Swader
Swader / .gitignore
Last active March 4, 2022 21:18
ultimate-gitignore
# Composer
vendor
composer.phar
# IntelliJ - PhpStorm and PyCharm
.idea
*.ipr
*.iws
# Eclipse
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"