Skip to content

Instantly share code, notes, and snippets.

View codejayant's full-sized avatar
:octocat:
learn and share!!

Jayant Sarkar codejayant

:octocat:
learn and share!!
View GitHub Profile
@codejayant
codejayant / JsonDynamicRootName.java
Created October 24, 2019 05:38
JSON parsing with dynamic root name
final Reader reader = response.readEntity(Reader.class);
final ObjectMapper objectMapper = new ObjectMapper();
final ExampleBean exampleRootName = objectMapper.reader().forType(StandardResponse.class).withRootName("exampleRootName").readValue(reader);

Chrome Debugging

1. Use node or nodemon command followed by debug parameter.
    Example : nodemon --inspect-brk server/server.js
2. Go to Chrome and open this link : chrome://inspect
3. Click on "Open dedicated DevTools for Node" link
4. Enjoy debugging
@codejayant
codejayant / object-file-write.js
Created November 7, 2017 10:47
node file write of object in JSON format using fs
const fs = require('fs');
// simple object creation
const simpleDataCreation = {
name: 'jayant',
age: 29,
city: 'sf'
};
// object creation and then adding property value
@codejayant
codejayant / mongo-notes.md
Last active November 26, 2017 02:46
MongoDB Notes

To start Mongo from mongo/bin folder execute this command
~/mongo/bin/mongod --dbpath ~/mongo-data/
where mongo-data is a folder in user directory.

To start mongo at terminal ./mongo

Mongo GUI : robomongo or robo 3T

@codejayant
codejayant / private-methods-with-closures.markdown
Last active September 26, 2017 23:50
private methods with closures

private methods with closures

private methods with closures Example 1 : with anonymous function Example 2 : with normal function

A Pen by jayant on CodePen.

License.

@codejayant
codejayant / Stack-Basic-Implementation.markdown
Last active July 23, 2017 01:23
Stack Basic Implementation in Javascript
@codejayant
codejayant / linked-list-basic-implementation.markdown
Last active July 12, 2017 07:06
Linked List Basic Implementation
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">