Skip to content

Instantly share code, notes, and snippets.

View rajanand02's full-sized avatar

Raj Anand rajanand02

View GitHub Profile
rajanand02 /
Created October 20, 2019 11:40
coding principles

Coding principles

  • When you are coding you are doing two things

    • Telling the machine to do a certain task for you
    • Telling others who might look at your code that this is what you are intending to do
    • We always focus on the 1st, not 2nd. IMO the point 2 is far more important than 1
  • Don't make your code complier friendly, make it human-friendly.

  • Everyone should be able to read your code like they are reading simple English.

  • Your code can be self-documented or you can add more documents in the form of comments and guides but more importantly, the code should tell a story. The reader should know where to start, how the move forward and where it ends.

rajanand02 /
Created January 25, 2017 07:41
Node and mongoDB installation.

Install nvm

curl -o- | bash

Source the bash or zsh profile

source ~/.bashrc

Install node
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var Extract = require('extract-text-webpack-plugin');
var AssetsPlugin = require('assets-webpack-plugin');
var CompressionPlugin = require('compression-webpack-plugin');
var webpack = require('webpack');
var DashboardPlugin = require('webpack-dashboard/plugin');
var PROD = process.env.NODE_ENV === 'production';
var DEV = !PROD;
var COMPRESS_FILES = process.env.COMPRESS_FILES === 'no';
"main": "index.js",
"scripts": {
"start": "webpack-dashboard -p 3001 webpack-dev-server --progress --inline",
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack",
"dependencies": {
"classnames": "^2.2.5",
"css-loader": "^0.23.1",
rajanand02 /
Last active October 30, 2015 12:55
Mercurial handbook

Mercurial Handbook


hg clone <repo url>

Create a branch

hg branch <branch name>

Add files

hg add filename

rajanand02 / index.html
Last active September 12, 2015 14:13
calling onload function multiple times without overriding the previously called function
<!DOCTYPE html>
<html lang="es">
<title>Window On Load</title>
<h1>Window on load</h1>
<script type="text/javascript" charset="utf-8">
var helloWorld = function (){
rajanand02 / style.css
Created June 3, 2015 17:38
Summer camp meteor session style sheet
body {
font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
margin: 3em 0;
padding: 0;
background-color: #315481;
background-image: -webkit-linear-gradient(top, #315481, #918e82 100%);
background-image: -moz-linear-gradient(top, #315481, #918e82 100%);
background-image: -o-linear-gradient(top, #315481, #918e82 100%);
background-image: linear-gradient(to bottom, #315481, #918e82 100%);
color: #333;
rajanand02 /
Created May 14, 2015 18:42
FSFTN Summer Camp 2015 Meteor Installation instruction.

FSFTN Summer Camp 2015 Meteor Installation instructions

Install node via NVM

curl -o- | bash

nvm install 0.12.3

nvm use 0.12.3

Download and install meteor
#! /bin/bash
yum remove ruby
yum install -y git-core curl make bzip2 gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel libxslt-devel sqlite sqlite-devel openssl openssl-devel
yum install -y nodejs
echo "adding rvm key"

##login as sudo user su ###then enter password

remove pre-installed ruby

yum remove ruby

check ruby was uninstalled successfully

ruby -v