Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Anees kodappana aneeskodappana

🏠
Working from home
View GitHub Profile
View district.php
<?php
return [
'Malappuram' => 'Malappuram',
'Thiruvananthapuram' => 'Thiruvananthapuram',
'Ernakulam' => 'Ernakulam',
'Thrissur' => 'Thrissur',
'Kozhikode' => 'Kozhikode',
'Palakkad' => 'Palakkad',
'Kollam' => 'Kollam',
'Kannur' => 'Kannur',
View states.php
<?php
return [
"AP" => "Andhra Pradesh",
"AR" => "Arunachal Pradesh",
"AS" => "Assam",
"BR" => "Bihar",
"CG" => "Chhattisgarh",
"Chandigarh" => "Chandigarh",
"DN" => "Dadra and Nagar Haveli",
View countries.php
<?php
return [
"Afghanistan" => "Afghanistan",
"Albania" => "Albania",
"Algeria" => "Algeria",
"Andorra" => "Andorra",
"Angola" => "Angola",
"Antigua & Deps" => "Antigua & Deps",
"Argentina" => "Argentina",
"Armenia" => "Armenia",
View DateUtil.java
package datastone.com.date;
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;
@aneeskodappana
aneeskodappana / Main.java
Created Jun 21, 2019
Java second to countdown --
View Main.java
package com.example.demo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import com.arover.moment.Moment;
import java.util.Timer;
import java.util.TimerTask;
@aneeskodappana
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">
Title
</div>
<div class="body" appScroll [offsetHeight]="200" (onBottomRached)="onBottomReached($event)">
<div class="content" *ngFor="let i of loop; let j = index">item - {{j+1}}</div>
</div>
@aneeskodappana
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
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, {
getGeneralToken,
removeGeneralToken,
} from "../services/token-service";
const instance = Axios.create();
instance.defaults.baseURL = "http://localhost:3000/graphql";
@aneeskodappana
aneeskodappana / questions.md
Last active Apr 8, 2021
NodeJS basic test questions
View questions.md

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?

View test.md

Task: URL shortener

Time limit : 3-4 Hour

Problem

Design a URL shortener service like (bit.ly). 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: https://example.com/assets/category_B/subcategory_C/Foo/