This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import path from 'path'; | |
| import webpack from 'webpack'; | |
| import autoprefixer from 'autoprefixer'; | |
| import CleanWebpackPlugin from 'clean-webpack-plugin'; | |
| import CopyWebpackPlugin from 'copy-webpack-plugin'; | |
| import ExtractTextPlugin from 'extract-text-webpack-plugin'; | |
| import devPlugins from './devPlugins'; | |
| import prodPlugins from './prodPlugins'; | |
| const basePlugins = (isDev, projectRootDir, outPath, srcPath) => [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "huntlyDashboard", | |
| "private": true, | |
| "version": "0.0.1", | |
| "description": "", | |
| "main": "", | |
| "scripts": { | |
| "_node": "./node_modules/.bin/babel-node --max-old-space-size=4096", | |
| "_webpack": "npm run -s _node -- ./node_modules/.bin/webpack", | |
| "_server": "npm run -s _node -- ./node_modules/.bin/webpack-dev-server", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import path from 'path'; | |
| import webpack from 'webpack'; | |
| import BowerWebpackPlugin from 'bower-webpack-plugin'; | |
| const isDevelopmentMode = true; | |
| const isHot = false; | |
| const srcPath = path.resolve(__dirname, 'src'); | |
| const outPath = path.resolve(__dirname, 'dist'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(self, Promise) { // (function(self) { | |
| 'use strict'; | |
| if (self.fetch) { | |
| return | |
| } | |
| var support = { | |
| searchParams: 'URLSearchParams' in self, | |
| iterable: 'Symbol' in self && 'iterator' in Symbol, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function arrayToObject(a, key) { | |
| const getKey = (key, v, k) => { | |
| if (key === 'identity') { | |
| return v; | |
| } else if (key) { | |
| return v[key] || k; | |
| } else { | |
| return k; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const DebounceRender = React.createClass({ | |
| mixins: [React.addons.PureRenderIgnoreFunctionsMixin], | |
| isRender: false, | |
| getDefaultProps() { | |
| return {wait: 400, showLoading: true}; | |
| }, | |
| componentWillMount() { | |
| this.forceRender = _.debounce(this.forceRender, this.props.wait); | |
| }, | |
| forceRender() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; api https://developer.github.com/v3/repos/comments/#create-a-commit-comment | |
| ;; aslo using https://github.com/sigma/gh.el and https://github.com/sigma/magit-gh-pulls | |
| (defun magit-gh-current-revision (current) | |
| (cond ((derived-mode-p 'magit-revision-mode) | |
| (car magit-refresh-args)) | |
| ((derived-mode-p 'magit-diff-mode) | |
| (--when-let (car magit-refresh-args) | |
| (and (string-match "\\.\\.\\([^.].*\\)?[ \t]*\\'" it) | |
| (match-string 1 it)))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function resolvePending(arrayOfPromises) { | |
| const d = $.Deferred(); | |
| let resolved = []; | |
| let rejected = []; | |
| const check = () => { | |
| if (resolved.length + rejected.length === arrayOfPromises.length) { | |
| rejected.length > 0 ? d.reject(rejected) : d.resolve(resolved); | |
| } | |
| }; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // <AsyncRender | |
| // data={[{}, {}, {}]} | |
| // name={'complex'} | |
| // onRender={(el, i) => <TimeConsumingComponent {...el}/>)} | |
| // /> | |
| // TODO: know issue, we need to restart the rendering if we got new data, | |
| // when rendering old one still is happening... | |
| // in proper place set pending: false, and bucket: [] | |
| const AsyncRender = React.createClass({ |