Skip to content

Instantly share code, notes, and snippets.

View borm's full-sized avatar
:octocat:

Dmitry Efimenko borm

:octocat:
View GitHub Profile
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"arrowFunctions": false, // enable arrow functions
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"classes": false, // enable classes
"defaultParams": false, // enable default function parameters
"destructuring": false, // enable destructuring
@borm
borm / .eslintrc.js
Created July 4, 2016 17:26 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@borm
borm / README.md
Created June 19, 2016 17:39 — forked from denji/README.md
Remove WebStorm; PhpStorm; PyCharm; RubyMine; AppCode; CLion, IntelliJ; 0xDBE10 settings and CLI-Links from Mac OSX

Quick uninstall JetBrains settings:

curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s
@borm
borm / object-watch.js
Created June 1, 2016 07:59 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@borm
borm / file-template.js
Created March 21, 2016 19:00 — forked from coderberry/file-template.js
Webstorm React Element Live Template and File Template
var React = require('react');
var ${NAME} = React.createClass({
render: function() {
return (
<div className="${NAME}">
</div>
)
}
});
@borm
borm / react-load.js
Created March 16, 2016 12:56 — forked from simenbrekken/react-load.js
React Static Component Load Method
/** @jsx React.DOM */
var AsyncComponent = React.createClass({
getInitialState: function() {
return {
}
},
render: function() {
return <div></div>
var pureRender = (Component) => {
Object.assign(Component.prototype, {
shouldComponentUpdate (nextProps, nextState) {
return !shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState);
}
});
};
module.exports = pureRender;
@borm
borm / pureRenderMixin.js
Created March 16, 2016 12:54 — forked from acdlite/pureRenderMixin.js
Pure Render Mixin in ES6
function pureRenderMixin(Component) {
Component.prototype.shouldComponentUpdate(nextProps, nextState) {
return !shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState);
}
return Component;
}
class MyComponent extends React.Component {}
@borm
borm / Enhance.js
Last active March 16, 2016 12:53 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@borm
borm / ajax.js
Created January 8, 2016 20:01 — forked from xeoncross/ajax.js
Simple, cross-browser Javascript POST/GET xhr request object. Supports request data and proper AJAX headers.
/**
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object
*
* @param string url
* @param object callback
* @param mixed data
* @param null x
*/
function ajax(url, callback, data, x) {
try {