Skip to content

Instantly share code, notes, and snippets.

Working from home

Anees kodappana aneeskodappana

Working from home
View GitHub Profile

Task: URL shortener

Time limit : 3-4 Hour


Design a URL shortener service like ( this service will provide short aliases redirecting to long URLs and also add the ability to attach tags to URLs.

For example, if we shorten this page through the service:

aneeskodappana /
Last active Apr 8, 2021
NodeJS basic test questions


1. Is console a global object?

  • A) Yes
  • B) No

answer (A)

2. Which method of fs module is used to close a file?

aneeskodappana / axios-client.js
Created Sep 24, 2020
Axios retry middleware for requests
View axios-client.js
import Axios from "axios";
import { LogService } from "../services/log-service";
import getAndRegisterGeneralToken, {
} from "../services/token-service";
const instance = Axios.create();
instance.defaults.baseURL = "http://localhost:3000/graphql";
aneeskodappana / javascript.json
Created Aug 25, 2020
Snippet for vscode to create a functional component
View javascript.json
"Make React Component": {
"prefix": "makeReactComponent",
"body": ["import React from 'react'; \n\nfunction ${1:$TM_FILENAME_BASE}(props) {\n\treturn (\t\n\t\t<div>$0</div>\n\t)\n} \nexport default ${1};"],
"description": "Make a react functional component"
aneeskodappana / app.component.html
Last active Oct 26, 2019
Angular scroll directive for element support for infinite scroll
View app.component.html
<div class="parent">
<div class="head">
<div class="body" appScroll [offsetHeight]="200" (onBottomRached)="onBottomReached($event)">
<div class="content" *ngFor="let i of loop; let j = index">item - {{j+1}}</div>
aneeskodappana /
Created Jun 21, 2019
Java second to countdown --
package com.example.demo;
import android.os.Bundle;
import android.widget.TextView;
import com.arover.moment.Moment;
import java.util.Timer;
import java.util.TimerTask;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
public class DateUtil {
private static final int SECOND_MILLIS = 1000;
View countries.php
return [
"Afghanistan" => "Afghanistan",
"Albania" => "Albania",
"Algeria" => "Algeria",
"Andorra" => "Andorra",
"Angola" => "Angola",
"Antigua & Deps" => "Antigua & Deps",
"Argentina" => "Argentina",
"Armenia" => "Armenia",
View states.php
return [
"AP" => "Andhra Pradesh",
"AR" => "Arunachal Pradesh",
"AS" => "Assam",
"BR" => "Bihar",
"CG" => "Chhattisgarh",
"Chandigarh" => "Chandigarh",
"DN" => "Dadra and Nagar Haveli",
View district.php
return [
'Malappuram' => 'Malappuram',
'Thiruvananthapuram' => 'Thiruvananthapuram',
'Ernakulam' => 'Ernakulam',
'Thrissur' => 'Thrissur',
'Kozhikode' => 'Kozhikode',
'Palakkad' => 'Palakkad',
'Kollam' => 'Kollam',
'Kannur' => 'Kannur',