Skip to content

Instantly share code, notes, and snippets.

View tomwayson's full-sized avatar
💭
Rockin' the dad jeans

Tom Wayson tomwayson

💭
Rockin' the dad jeans
View GitHub Profile
@fatso83
fatso83 / gist:88370e1d75de2b9ba00b
Created March 9, 2015 16:08
Gulp config for babelify
var gulp = require('gulp');
var source = require('vinyl-source-stream'); // Used to stream bundle for further handling
var browserify = require('browserify');
var watchify = require('watchify');
var gulpif = require('gulp-if');
var uglify = require('gulp-uglify');
var streamify = require('gulp-streamify');
var notify = require('gulp-notify');
var concat = require('gulp-concat');
var cssmin = require('gulp-cssmin');
@Fishrock123
Fishrock123 / gulp.js
Last active August 1, 2021 11:19
gulp & browserify (+watchify +babelify)
var gulp = require('gulp')
var browserify = require('browserify')
var watchify = require('watchify')
var babelify = require('babelify')
var source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer')
var merge = require('utils-merge')
@chantastic
chantastic / on-jsx.markdown
Last active March 20, 2024 01:03
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

How are classes different from traditional functions?

ES6 introduced a new protocol for constructing instances, but its features (incl. new.target) work in both classes and traditional functions. These are the differences between traditional functions and classes:

  • Traditional functions can’t make superconstructor calls via super(). That means that they are always base classes. In ES5, superconstructors are called as functions.

  • The prototype of traditional functions and base classes is Function.prototype. The prototype of a derived class is its superclass.

  • Classes can’t be function-called. An exception is thrown if you do.

@thollingshead
thollingshead / Dojo_Templated_Widget.sublime-snippet
Created February 4, 2016 19:07
Sublime snippet for Dojo templated widget boilerplate
<snippet>
<content><![CDATA[
define([
'dijit/_TemplatedMixin',
'dijit/_WidgetBase',
'dojo/_base/declare',
${2:
'dojo/i18n!./$1/nls/resources',}
'dojo/text!./$1/templates/$1.html'${5:,
@thollingshead
thollingshead / Dojo_Widget.sublime-snippet
Last active February 4, 2016 20:35
Sublime snippet for Dojo widget boilerplate.
<snippet>
<content><![CDATA[
define([
'dijit/_WidgetBase',
'dojo/_base/declare'
], function(
_WidgetBase,
declare
) {
@thollingshead
thollingshead / Dojo_Module.sublime-snippet
Created February 4, 2016 19:11
Sublime snippet for Dojo module boilerplate.
<snippet>
<content><![CDATA[
define([
${1:'dojo/_base/declare'}
], function(
${2:declare}
) {
return declare([$3], {
$4
});
@thollingshead
thollingshead / Commented_Dojo_Widget.sublime-snippet
Created February 4, 2016 21:06
Sublime snippet for Dojo widget boilerplate, with commented out lifecycle methods.
<snippet>
<content><![CDATA[
define([
'dijit/_WidgetBase',
'dojo/_base/declare'
], function(
_WidgetBase,
declare
) {
@odoe
odoe / gulpfile.js
Created February 11, 2016 19:04
Sample gulpfile for Dojo builds
var gulp = require('gulp');
var clean = require('gulp-clean');
var rename = require("gulp-rename");
var spawn = require('child_process').spawn;
gulp.task('clean-dist', function () {
return gulp.src('dist/', { read: false })
.pipe(clean());
});
@gund
gund / index.html
Last active February 12, 2024 00:06
ArcGIS JSAPI setup build with Webpack for production (start reading from webpack.config.js)
<!DOCTYPE html>
<html>
<head>...</head>
<body>
<!-- Load Esri lib -->
<link rel="stylesheet" href="//js.arcgis.com/4.0/esri/css/main.css">
<script src="//js.arcgis.com/4.0/"></script>
<!-- Load our AMD app -->
<script type="text/javascript">
// Wrap our app startup in AMD module