Skip to content

Instantly share code, notes, and snippets.

View ManishPoduval's full-sized avatar
💭
I may be slow to respond.

Manish Poduval ManishPoduval

💭
I may be slow to respond.
View GitHub Profile

Using Maps in your Express app with Leaflet.js

You can find the sample working code here

Installation

1. Set up Leaflet css/js files

Using Charts in your Express app with ChartJS

You can find the sample working code here

Installation

1. Set up ChartJS

Lottie Animation

1. Install package

We will use this package to show lottie animations on our site

In your React code terminal run

Maps in React

1. Install package

We will use this package to show a map on our site

Calendars in React

1. Install package

We will use this package to show an interactive calendar on our site

In your React code terminal run

import React, { Component } from 'react';
import { LinkedIn } from 'react-linkedin-login-oauth2';
import linkedin from 'react-linkedin-login-oauth2/assets/linkedin.png'
class LinkedInButton extends Component {
render() {
const { onSuccess, onFailure } = this.props
return (
<div>
const router = require("express").Router();
// Lazy me, I don't have time to convert superagent to axios
const request = require('superagent');
const UserModel = require('../models/User.model')
function requestAccessToken(code) {
return request.post('https://www.linkedin.com/oauth/v2/accessToken')
.send('grant_type=authorization_code')
.send(`redirect_uri=${process.env.LINKEDIN_REDIRECT_URI}`)
.send(`client_id=${process.env.LINKEDIN_CLIENT_ID}`)
const router = require("express").Router();
const UserModel = require('../models/User.model')
// The client makes a API request to this url sending the data in the body
router.post("/facebook/info", (req, res, next) => {
const {name, email, image, facebookId} = req.body
// the name itself will include the last name
try {
// Create the user in the DB
UserModel.create({firstName: name, facebookId, image, email})