Skip to content

Instantly share code, notes, and snippets.

@evangoer
evangoer / index.html
Last active April 7, 2017 22:40 — forked from anonymous/index.html
Starter React jsbin with JSX
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Starter React jsbin with JSX">
<script src="http://fb.me/react-with-addons-0.13.1.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
@evangoer
evangoer / jsdom-mocha-react
Created July 23, 2014 07:17
jsdom + mocha testing of a React component, with no build step required.
var React = require('React/addons'),
assert = require('assert');
var Hello = React.createClass({
render: function () {
return React.DOM.p(null, 'hello');
}
});
var jsdom = require('jsdom');
@evangoer
evangoer / readme.md
Last active December 15, 2015 06:19 — forked from max-mapper/readme.md

I wrote this for a colleague at work, but I thought I'd share it here for those that are confused as to the role of a build tool. To those that have not spent years working with various build tools, it may be tempting to find one that is written in the language you are using (i.e. Phing, Ant, Rake, and Grunt come to mind) or perhaps you are easily persuaded by things that have a lot of features (Gradle immediately comes to mind).

To be honest, build tools are just glorified shell script wrappers. Some more complex than others. At the end of the day, a build tool should do four things to be useful and not get in the way:

  1. Run your scripting tasks (where less abstraction layers are better than more).
  2. Allow you to define dependencies (like, always run the task to delete all of the build artifacts before running the task that generates code coverage).
  3. Give you a simple way (preferably without needing to install a fancy GUI/IDE) to look at what build steps will be run without running them.
  4. Issue a s
@evangoer
evangoer / gist:3383213
Created August 17, 2012 22:16
Rough draft YUI Getting Started Guide

Getting Started with YUI

Welcome to the YUI library! This tutorial contains everything you need to get up and running quickly with YUI. If you've never used YUI before, but you perhaps have a little experience with plain JavaScript or JavaScript frameworks, read onward.

Note that if you have experience with jQuery, it is a great idea to read or at least skim through the JS Rosetta Stone, which demonstrates how common jQuery and YUI idioms map to each other. The good news is that in the areas where YUI and jQuery overlap, you'll find that it is not too difficult to translate back and forth between the two.

Loading SimpleYUI

The easiest way to get started with YUI is to use SimpleYUI, a convenient package for working with DOM nodes, events, UI effects, and AJAX.

Improvements to New YUI Blog Theme

Objective

  • Wrong copyright. Should be: "© 2012 Yahoo! Inc." not: "© 2012 YUI Blog"
  • Search page is unusable: http://cl.ly/IiYS
  • Linen texture should only be at the lowest layer of the design (I don't care that iOS uses it for the notification sheets, they did it wrong :)
  • Home page's heading alignments are off:
@evangoer
evangoer / gist:3174385
Created July 25, 2012 04:24
Feedback for Open Tech School: JS Beginners Day 1

Page 1

The language of the material is friendly and low-key -- this is great.

Open the console

For students who don't even yet know HTML or CSS, I like your general approach a lot:

@evangoer
evangoer / gist:1389107
Created November 23, 2011 16:21
A dirt-simple, least-common-denominator web service used for the Y.io() examples in the YUI 3 Cookbook.
<?php
header('Content-type: application/json');
$response = array();
if (isset($_GET['library']) && $_GET['library'] === 'YUI') {
$response['advice'] = 'YES';
$response['reason'] = "YUI doesn't eat your soul from the inside.";
}
else {
$response['advice'] = 'NO';
@evangoer
evangoer / gist:1250052
Created September 29, 2011 05:37
A more sugary way to create Y.Base derived objects.
/* What do we really care about when creating a Base-derived object?
1. the object we are deriving from
2. string name
3. properties and methods
4. attributes
Goals: simpler method with fewer args & less nesting. Simplify
adding attributes. No need for empty [] hack as with Y.Base.create() */
Y.Example = Y.Model.derive('example-model', {
// prototype methods and properties here
hello: function () {