Skip to content

Instantly share code, notes, and snippets.

View rogaldh's full-sized avatar

Sergo rogaldh

View GitHub Profile
/**
* class.js
* @author Dmitry A. Soshnikov
*/
function Class(params) {
/**
* Constructor function
* If not specified, use default
@rogaldh
rogaldh / pubsub.js
Last active August 29, 2015 14:02
pubsub.js
/**
* Events. Pub/Sub system for Loosely Coupled logic.
* Based on Peter Higgins' port from Dojo to jQuery
* https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js
*
* Re-adapted to vanilla Javascript by @Couto https://github.com/Couto
*
* @class Events
*/
var Events = (function (){
var WebpackDevServer = require('webpack-dev-server');
var webpack = require('webpack');
var config = require('./webpack.config');
var argv = require('yargs')
.boolean('p').alias('p', 'optimize-minimize')
.boolean('h').alias('h', 'hot')
.argv;
var contentBase = './public/';

Files

A basic stucture of a React+Flux application (see other examples)

 - /src/actions/PageActions.js    - Flux action creator
 - /src/constants/ActionTypes.js  - Flux action types
 - /src/layouts/DefaultLayout.js  - Page layout reused accross multiple top-level components
 - /src/pages/DemoPage.js         - A top-level react component (page)
 - /src/stores/PageStore.js       - Flux store
var React = require('react/addons');
var Reflux = require('reflux');
var when = require('when');
var UserAPI = {
signin: function(username, password) {
var deferred = when.defer();
setTimeout(function() {
if (Math.random() >= 0.5) {
var format = require('util').format;
var WebpackDevServer = require('webpack-dev-server');
var webpack = require('webpack');
var config = require('./webpack.config');
var argv = require('yargs')
.boolean('h').alias('h', 'hot')
.argv;
var contentBase = {
#!/bin/bash
##############
echo "
//////////////////////////////////////
// //
// Welcome to MODx autoinstaller. //
// //
//////////////////////////////////////

browserify for webpack users

There's been a strange explosion in misinformation about browserify recently, particularly in comparisons to webpack.

Generally speaking, most of this confusion stems from how webpack is more willing to pull features into its core to ease discoverability while browserify is more likely to push features out to userland instead.

I think that longer-term, separability has more benefits from a maintenance and

var format = require('util').format;
var WebpackDevServer = require('webpack-dev-server');
var webpack = require('webpack');
var config = require('./webpack.config');
var argv = require('yargs')
.boolean('h').alias('h', 'hot')
.argv;
var contentBase = {

Files

The basic structure of a React+Flux application (see other examples)

 - /src/actions/AppActions.js     - Action creators (Flux)
 - /src/components/Application.js - The top-level React component
 - /src/constants/ActionTypes.js  - Action types (Flux)
 - /src/core/Dispatcher.js        - Dispatcher (Flux)
 - /src/stores/AppStore.js        - The main store (Flux)