Skip to content

Instantly share code, notes, and snippets.

Avatar

Ashish Kumar Singh ashishkumarsinghh

  • Samsung
  • Delhi, India
View GitHub Profile
@ashishkumarsinghh
ashishkumarsinghh / dbsetup.js
Created Nov 12, 2018
MongoDB setup with Hapi.js
View dbsetup.js
const mongoose = require("mongoose");
mongoose.connect(
`mongodb://localhost/experiences`,
{ useNewUrlParser: true }
);
const expSchema = mongoose.Schema({
title: String,
description: String,
@ashishkumarsinghh
ashishkumarsinghh / routes.js
Created Nov 12, 2018
Handling GET/POST requests in Hapi.js
View routes.js
const expModel = require("./dbsetup");
const routes = [
{
method: "GET",
path: "/api/",
handler: (req, res) => {
return `Hello There !`;
}
},
View SinglyLinkedList.java
package SelfPractice;
public class SLLNode{
int data;
SLLNode next;
SLLNode(int data){
this.data = data;
this.next = null;
}
@ashishkumarsinghh
ashishkumarsinghh / PureFunction.java
Created Jul 17, 2018
A simple example of Pure Function
View PureFunction.java
private int sum (int a , int b){
return a + b;
}