Skip to content

Instantly share code, notes, and snippets.

Avatar
🐌
Not only working software but also well crafted software.

Dattatray Kale way2datta

🐌
Not only working software but also well crafted software.
View GitHub Profile
View code-retreat-first-round.cs
using System;
using System.Collections.Generic;
using System.Linq;
namespace Assignment
{
internal class Program
{
private static Dictionary<string, int> CGR = new Dictionary<string, int>();
private static Dictionary<string, string> iCat = new Dictionary<string, string>();
View code-retreat-first-round-after-meaningful_names.cs
using System;
using System.Collections.Generic;
namespace NMart.Billing
{
internal class NMartStore
{
private static Dictionary<string, int> CategoryGstRatesInPercentage = new Dictionary<string, int>();
private static Dictionary<string, string> ItemsInCategory = new Dictionary<string, string>();
View code-retreat-second-round-extract-method.cs
using System;
using System.Collections.Generic;
namespace NMart.Billing
{
internal class NMartStore
{
private static Dictionary<string, int> CategoryGstRatesInPercentage = new Dictionary<string, int>();
private static Dictionary<string, string> ItemsInCategory = new Dictionary<string, string>();
View expense-tracker-routes.js
const express = require('express');
const app = express();
const port = 3000;
app.get('/', (request, response) => response.send('Hello World!'));
app.get('/users', (request, response) => response.send("Get users"));
app.get('/users/:id', (request, response) => response.send("Get user by id"));
@way2datta
way2datta / Route-expense-tracker-after.js
Last active Nov 21, 2018
Well formatted readable urls for rest api's
View Route-expense-tracker-after.js
import { Router } from 'express';
import { LoginController } from '../controllers/loginController';
import { AuthController } from "../controllers/authController";
import { UserController } from "../controllers/userController";
import { ExpenseCategoryController } from "../controllers/expenseCategoryController";
import { ExpenseController } from "../controllers/expenseController";
const router = Router();
const loginController = new LoginController();
@way2datta
way2datta / Route-expense-tracker-before.js
Last active Nov 21, 2018
Route-expense-tracker-before.js
View Route-expense-tracker-before.js
import { Router } from 'express';
import { LoginController } from '../controllers/loginController';
import { AuthController } from "../controllers/authController";
import { UserController } from "../controllers/userController";
import { ExpenseCategoryController } from "../controllers/expenseCategoryController";
import { ExpenseController } from "../controllers/expenseController";
const router = Router();
const loginController = new LoginController();
@way2datta
way2datta / well-formatted-and-readable
Last active Nov 21, 2018
Well formatted readable urls
View well-formatted-and-readable
HTTP POST http://localhost:3000/login
HTTP POST http://localhost:3000/authorize
HTTP POST http://localhost:3000/register
HTTP GET http://localhost:3000/users
HTTP GET http://localhost:3000/users/:id
HTTP DELETE http://localhost:3000/users/:id
HTTP PUT http://localhost:3000/users/:id
HTTP POST http://localhost:3000/users
HTTP GET http://localhost:3000/users/:id/expenses/categories
HTTP GET http://localhost:3000/users/:id/expenses/categories/:categoryId
@way2datta
way2datta / Poorly formatted and poorly named urls and http methods
Last active Nov 21, 2018
Poorly formatted and poorly named urls and http methods
View Poorly formatted and poorly named urls and http methods
HTTP GET http://localhost:3000/userJWTValidation
HTTP GET http://localhost:3000/JwtValidation
HTTP GET http://localhost:3000/creationOfUserDetails
HTTP GET http://localhost:3000/getAllusersDetails
HTTP GET http://localhost:3000/fetchUserDetails
HTTP GET http://localhost:3000/deletionOfUserDetails
HTTP GET http://localhost:3000/updationOfUserDetails
HTTP GET http://localhost:3000/getExpenseCategoryOfUsers
HTTP GET http://localhost:3000/getExpenseCategoryOfUser
HTTP GET http://localhost:3000/deletionExpenseCategoryOfUser
@way2datta
way2datta / list-urls-and-verbs-in-restful-service.js
Created Nov 22, 2018
List down endpoints urls and http verbs that was built by using Node + Express
View list-urls-and-verbs-in-restful-service.js
const express = require('express');
import routes from './routes/rest-api';
const app = express();
const port = 3000;
const hostUrl = "http://localhost:3000"
app.use('/', routes);
routes.stack.forEach(function (element) {
@way2datta
way2datta / ExpenseTracker.txt
Created Nov 25, 2018
Simple Expense tracker application for study purpose
View ExpenseTracker.txt
**Use Cases**
- User can register his/her account.
- An account owner can log into the system.
- An account owner can view, add, update, and delete category for expenses.
- An account owner can view, add, update, and delete expense.