Skip to content

Instantly share code, notes, and snippets.

View nsisodiya's full-sized avatar

Narendra Sisodiya nsisodiya

View GitHub Profile
@tjjfvi
tjjfvi / killByPort.sh
Created October 10, 2018 22:09
*nix Bash Kill By Port
#!/usr/bin/env bash
kill `netstat -tulpn | grep :$1 | sed -e "s/.*LISTEN *//" -e 's/\/.*//'`
@zackify
zackify / .eslintrc
Last active December 21, 2015 17:57
Upgrade to Babel 6
{
"parser": "babel-eslint",
"env": {
"es6": true,
"mocha": true,
"node": true
},
"ecmaFeatures": {
"blockBindings": true,
"forOf": true,
@boopathi
boopathi / README.md
Last active August 29, 2015 14:27
Differentiate between an arrow function, class, method, generator and a normal function in ES6
@gaearon
gaearon / combining.js
Created June 3, 2015 18:03
Combining Stateless Stores
// ------------
// counterStore.js
// ------------
import {
INCREMENT_COUNTER,
DECREMENT_COUNTER
} from '../constants/ActionTypes';
const initialState = { counter: 0 };
@aldendaniels
aldendaniels / alternative-to-higher-order-components.md
Last active October 6, 2018 09:50
Alternative to Higher-order Components

React now supports the use of ES6 classes as an alternative to React.createClass().

React's concept of Mixins, however, doesn't have a corollary when using ES6 classes. This left the community without an established pattern for code that both handles cross-cutting concerns and requires access to Component Life Cycle Methods.

In this gist, @sebmarkbage proposed an alternative pattern to React mixins: decorate components with a wrapping "higher order" component that handles whatever lifecycle methods it needs to and then invokes the wrapped component in its render() method, passing through props.

While a viable solution, this has a few drawbacks:

  1. There's no way for the child component to override functionality defined on the higher order component.
@nolanlawson
nolanlawson / index.html
Created October 12, 2014 13:41
Create an image/png blob, then fetch it with XHR
<html>
<body>
<h1>Create an image/png blob, then fetch it with XHR</h1>
<pre id="display"></pre>
<script src="index.js"></script>
</body>
</html>
anonymous
anonymous / gist:4668741d2f324a393b9f
Created July 16, 2014 19:34
REPORT OF THE SANSKRIT COMMISSION 1956-57
REPORT OF THE SANSKRIT COMMISSION 1956-57
Table of Contents
INTRODUCTION
HISTORICAL RETROSPECT
THE PRESENT SITUATION
@nicolashery
nicolashery / Makefile
Created March 21, 2014 11:17
Building UMD modules with dependencies with Browserify
dist:
browserify \
--external lodash \
--external moment \
--require ./index.js:robot \
> bundle.js
cat umd-head.js bundle.js umd-tail.js > robot.js
@nsisodiya
nsisodiya / color1.scss
Created April 17, 2013 11:18
Manage Theme with SASS
$boxwidth: 300px;
$boxheight: 200px;
$boxbackgroundcolor: #456343;
$whiteFontColor:#E3E1E1;
$bigFontsSize: 30px;