Skip to content

Instantly share code, notes, and snippets.

Sitian Liu goldensunliu

Block or report user

Report or block goldensunliu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jhollingworth
jhollingworth / marty-to-redux.md
Last active Mar 24, 2016
Translating Marty to Redux
View marty-to-redux.md

#Translating Marty to Redux

Some people have asked how I've translated a Marty app to Redux. Once you get your head around how Redux works I found concepts in Marty translated easily. Below is side-by-side comparison of the two libraries to help you along the way.

Also if you're looking for some devtools, check out redux-devtools.

##Constants

Marty

@xjamundx
xjamundx / blog-webpack-2.md
Last active Jun 14, 2019
From Require.js to Webpack - Part 2 (the how)
View blog-webpack-2.md

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@gaearon
gaearon / combining.js
Created Jun 3, 2015
Combining Stateless Stores
View combining.js
// ------------
// counterStore.js
// ------------
import {
INCREMENT_COUNTER,
DECREMENT_COUNTER
} from '../constants/ActionTypes';
const initialState = { counter: 0 };
@Couto
Couto / webpack.js
Last active Mar 18, 2019
Fetch polyfill with webpack
View webpack.js
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var folders = {
APP: path.resolve(__dirname, '../app'),
BUILD: path.resolve(__dirname, '../build'),
BOWER: path.resolve(__dirname, '../bower_components'),
NPM: path.resolve(__dirname, '../node_modules')
};
@gaearon
gaearon / createAsyncPage.jsx
Last active Mar 23, 2018
Webpack's async code splitting with React Router
View createAsyncPage.jsx
'use strict';
var React = require('react');
function createAsyncHandler(getHandlerAsync, displayName) {
var Handler = null;
return React.createClass({
displayName: displayName,
@addyosmani
addyosmani / visibly.js
Created Aug 3, 2011
Cross-browser Page Visibility API polyfill
View visibly.js
/*!
* isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill
* Copyright (c) 2011 Addy Osmani
* Dual licensed under the MIT and GPL licenses.
*/
(function () {
window.visibly = {
b: null,
q: document,
You can’t perform that action at this time.