Skip to content

Instantly share code, notes, and snippets.

View manavsehgal's full-sized avatar

Manav Sehgal manavsehgal

View GitHub Profile
@manavsehgal
manavsehgal / webpack.lint.config.js
Created May 24, 2016 11:03
Webpack configuration for running Browsersync, ESLint and StyleLint along with Hot Reloading
// Initialization
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const postcssImport = require('postcss-easy-import');
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
const path = require('path');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const APP = path.join(__dirname, 'app');
@manavsehgal
manavsehgal / wikipedia-acquire-dataset-from-table-manavsehgal-com.ipynb
Last active April 4, 2017 10:14
Wikipedia Acquire Dataset From Table | ManavSehgal.com
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manavsehgal
manavsehgal / .eslintrc.js
Created May 24, 2016 11:51
ESLint configuration to use React, Babel, Airbnb rules, ES6, custom rules
module.exports = {
"parser": "babel-eslint",
"rules": {
"strict": 0
},
"env": {
"browser": true,
"es6": true,
"jquery": true
},
@manavsehgal
manavsehgal / CardStackCharts.jsx
Last active June 16, 2016 08:10
Animated Basic Charts in D3 and React. Using Rumble Charts and ReactSpeed starter project.
import React from 'react';
import Card from './Card.jsx';
import { series, singleSeries, cloudSeries } from '../fixtures/charts/series';
const {
// main component
Chart,
// graphs
Bars, Cloud, Labels, Lines, Pies, RadialLines, Ticks,
@manavsehgal
manavsehgal / series.js
Created June 16, 2016 07:51
Fixture for chart data going into CardStackCharts.jsx component hierarchy rendering Rumble Charts.
export const singleSeries = [{
data: [1, 2, 4]
}];
export const series = [{
data: [1, 2, 3]
}, {
data: [5, 7, 11]
}, {
data: [13, 17, 19]
@manavsehgal
manavsehgal / Hello.jsx
Created May 31, 2016 02:53
Custom Hello stateless component
import React from 'react';
const Hello = ({ greet, message }) => (
<h3>
{greet} {message}
</h3>
);
Hello.propTypes = {
greet: React.PropTypes.string,
@manavsehgal
manavsehgal / World.jsx
Created May 31, 2016 02:41
Custom World component explaining essential ES6 concepts
import React from 'react';
import Hello from './Hello.jsx';
export default class World extends React.Component {
constructor(props) {
super(props);
this.state = {
currentGreeting: props.greet,
value: 'ReactSpeed'
@manavsehgal
manavsehgal / Navigation.jsx
Created May 24, 2016 16:31
Refactor Navigation React component using child NavLink component
import React from 'react';
import NavLink from './NavLink.jsx';
function Navigation() {
return (
<ul className="navigation grid grid-gutters large-grid-fit med-grid-fit small-grid-1of2">
<NavLink className="navigation-link" to="/" brand>ReactSpeed</NavLink>
<NavLink className="navigation-link" href="https://leanpub.com/reactspeedcoding">
<i className="fa fa-book"></i> Book
</NavLink>
@manavsehgal
manavsehgal / NavLink.jsx
Created May 24, 2016 13:54
NavLink React component to encapsulate React Router Link and regular href links
@manavsehgal
manavsehgal / navigation.css
Created May 24, 2016 13:49
Navigation component style using PostCSS processing
.navigation {
list-style: none;
background: $secondary;
margin: 0;
padding-right: 10px;
}
.sidenav {
list-style: none;
background: $golden-light;