Skip to content

Instantly share code, notes, and snippets.

View manavsehgal's full-sized avatar

Manav Sehgal manavsehgal

View GitHub Profile
@manavsehgal
manavsehgal / opentheme-custom-embeds
Last active August 29, 2015 14:10
Examples of OpenTheme Custom Embeds in Markdown
<!-- YouTube Video -->
{% include embed-youtube.html video="eRsGyueVLvQ" %}
<!-- Google Map -->
{% include embed-google-map.html location="The+Shard+London" %}
@manavsehgal
manavsehgal / gist:188a559ad5904d4db7a8
Created December 28, 2015 07:18
angular2-webpack-starter npm run build:prod WARN
WARNING in common.js from UglifyJs
Side effects in initialization of unused variable RequestMethod [./~/angular2/src/http/enums.js:13,0]
Side effects in initialization of unused variable ReadyState [./~/angular2/src/http/enums.js:27,0]
Side effects in initialization of unused variable ResponseType [./~/angular2/src/http/enums.js:39,0]
Side effects in initialization of unused variable freeExports [./~/rxjs/util/root.js:11,0]
Side effects in initialization of unused variable freeModule [./~/rxjs/util/root.js:12,0]
Non-strict equality against boolean: != true [./~/angular2/src/compiler/html_tags.js:294,0]
Side effects in initialization of unused variable PropertyBindingType [./~/angular2/src/compiler/template_ast.js:228,0]
Side effects in initialization of unused variable metadata_1 [./~/angular2/src/core/linker/template_commands.js:18,0]
Side effects in initialization of unused variable ViewType [./~/angular2/src/core/linker/view.js:28,0]
@manavsehgal
manavsehgal / index.jsx
Created May 24, 2016 13:33
React app entry for basic use case of React Router
import React from 'react';
import ReactDOM from 'react-dom';
import BlogPage from './components/BlogPage.jsx';
import HomePage from './components/HomePage.jsx';
import { Router, Route, hashHistory } from 'react-router';
ReactDOM.render(
<Router history={hashHistory}>
<Route path="/" component={HomePage}/>
@manavsehgal
manavsehgal / Navigation.jsx
Created May 24, 2016 13:42
React Navigation component. First iteration using React Router Link.
import React, { PropTypes } from 'react';
import { Link } from 'react-router';
class Navigation extends React.Component {
render () {
return (
<ul className="navigation grid grid-gutters large-grid-fit med-grid-fit small-grid-1of2">
<li className="grid-cell">
<Link className="navigation-link navigation-brand" to="/">
ReactSpeed
@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;
@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.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 / 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 / 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 / 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]