Skip to content

Instantly share code, notes, and snippets.

View ronit-mukherjee's full-sized avatar

Ronit Mukherjee ronit-mukherjee

View GitHub Profile
@ronit-mukherjee
ronit-mukherjee / index.js
Created June 16, 2018 01:43
index.js file of create-react-app to display list of products in React, show bought quantities, show total amount and show individual products
/*
* Author:- Ronit Mukherjee
* Email:- connect.ronit@gmail.com
* Website:- ronitmukherjee.com
* CreatedOn:- 16-06-2018 7:12 AM
*/
import React from 'react';
import ReactDOM from 'react-dom';
@ronit-mukherjee
ronit-mukherjee / Wrapper.js
Created June 16, 2018 02:00
React HOC - Wrap any of your page level contents in this wrapper to exclude the use of additional div as parent component required by react render, secondly this wrapper component helps to set page level seo meta tags like title, description, keywords buy just passing these in props to it
import React from 'react'
import {Helmet} from 'react-helmet'
export default (props) => (
<div id={props.id?props.id:""}>
{
props.title ||
props.description ||
props.keywords ?
@ronit-mukherjee
ronit-mukherjee / WithLoader.css
Last active June 16, 2018 02:30
WithLoader is a React + Redux Higher Order Component (HOC) which is used to add loader functionality to any React + Redux Component
/*
* Author:- Ronit Mukherjee <connect.ronit@gmail.com> [ronitmukherjee.com]
* CreatedOn:- 16-06-2018
*/
.with-loader{
position: relative;
width: 100%;
height: 100%;
z-index: 1;
}
@ronit-mukherjee
ronit-mukherjee / ApplePushNotification.php
Created July 4, 2018 07:32
Send APNS(Apple Push Notification) using PHP
<?php
/*
* @author Ronit Mukherjee
* @createdOn 03-07-2018
*/
namespace apple_push_notification;
require_once "ApplePushNotificationException.php";
@ronit-mukherjee
ronit-mukherjee / FacebookLoginButton.js
Created July 23, 2018 01:47
React Facebook Login Button Component
/*global FB*/
import React, {Component} from 'react';
class FacebookLoginButton extends Component{
componentDidMount() {
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {
return;
}
@ronit-mukherjee
ronit-mukherjee / main.js
Created August 28, 2018 11:23
HackerRank - Diagonal Difference (JS)
'use strict';
const fs = require('fs');
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
@ronit-mukherjee
ronit-mukherjee / main.js
Created August 28, 2018 12:51
HackerRank - Right Aligned Triangle (JS)
//https://www.hackerrank.com/challenges/staircase/problem
'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
@ronit-mukherjee
ronit-mukherjee / main.js
Created August 28, 2018 12:53
HackerRank - Mini-Max sum (JS)
//https://www.hackerrank.com/challenges/mini-max-sum/problem
'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
@ronit-mukherjee
ronit-mukherjee / main.js
Created August 28, 2018 14:10
HackerRank - Bithday Cake Candle (JS)
//https://www.hackerrank.com/challenges/birthday-cake-candles/problem
'use strict';
const fs = require('fs');
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
@ronit-mukherjee
ronit-mukherjee / gulpfile.js
Last active September 26, 2018 08:44
Boilerplate to setup project with support of Bootstrap 4, ES6 and Live Reload using Gulp
const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const babel = require('gulp-babel');
const concat = require('gulp-concat');
const sass = require('gulp-sass');
const autoprefixer = require('autoprefixer');
const browserSync = require('browser-sync').create();
const htmlmin = require('gulp-htmlmin');
const inject = require('gulp-inject');
const minifyJS = require("gulp-uglify");