This file contains 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 isValidEmail(email) { | |
return email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/); | |
} | |
function getUserByEmail(email) { | |
return new Promise((resolve) => { | |
setTimeout(() => { | |
// keep rejections for exceptions only | |
if (email !== '[email protected]') { | |
return resolve(null); |
This file contains 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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var $ = require('jquery'); | |
$(function () { $('body').append('<p>Hello world from app here!</p>'); }) |
This file contains 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
npm i | |
> [email protected] postinstall /Users/roy/tmp/eslint/node_modules/beefy/node_modules/chokidar | |
> node setup-deps.js | |
Executing npm install [email protected] [email protected] | |
npm WARN package.json [email protected] No license field. | |
../nodefsevents.cc:31:30: error: expected class name | |
class NodeFSEvents : node::ObjectWrap { | |
^ |
This file contains 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
npm i --save https://github.com/:username/:reponame/tarball/:branchname | |
# Via http://package.json.nodejitsu.com/ |
This file contains 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
var Tap = require( 'tap.js' ); | |
var $ = require( 'jquery' ); | |
var tap = new Tap( document ); | |
require( 'document-register-element/build/document-register-element.js' ); | |
//var escape = require('escape-html'); | |
var btn = document.querySelector( 'button' ); | |
btn.addEventListener( 'tap', function ( e ) { | |
console.log( 'tap, tap', e.target ); | |
} ) |
This file contains 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
var data = window.jsonData; | |
var $ = require('jquery'); | |
var React = require('react/addons'); | |
var throttle = require('throttly'); | |
var rand = function rand() { | |
var min, max, | |
args = arguments; | |
//if only one argument is provided we are expecting to have a value between 0 and max | |
if ( args.length === 1 ) { | |
max = args[ 0 ]; |
This file contains 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
var $ = require('jquery'); | |
$(function () { | |
var React = require('react/addons'); | |
var throttle = require('throttly'); | |
var rand = function rand() { | |
var min, max, | |
args = arguments; | |
//if only one argument is provided we are expecting to have a value between 0 and max |
This file contains 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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Rebuild to run it on the right | |
var esformatter = require( 'esformatter' ); | |
var esformatterJSX = require( 'esformatter-jsx' ); | |
var collapser = require('esformatter-collapse-objects') | |
var throttle = require('lodash.throttle'); | |
var testCode = '// Paste your own code here...\n\n\n\ var Comment = React.createClass({\n render: function() {\n return (\n <div className="comment">\n <h2 className="commentAuthor">\n {this.props.author}\n </h2>\n {this.props.children}\n </div>\n );\n }\n});'; | |
var supportStorage = true; |
This file contains 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
var w = window; | |
var $ = require('jquery'); | |
var esformatter = require('esformatter'); | |
$('.code-pair').each(function () { | |
var $this = $(this); | |
var source = $this.find('.source').text(); | |
var $result = $this.find('.result'); |
This file contains 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 React = require('react'); | |
const dynamics = require('dynamics.js'); | |
/** | |
* Using dynamics.js to transition things or just animate | |
* ------------------------------------------------------ | |
* props: | |
* - runTo enum("start", "finish) - which way to run. | |
* - onComplete callback | |
* - onChange callback |