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
<!doctype html> | |
<html> | |
<head> | |
<title>Font-size unit comparisons</title> | |
<style type="text/css"> | |
* { | |
margin: 0; | |
padding: 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
Ply.ui.define('html', { | |
__elements: { | |
body: 'body' | |
}, | |
__partials: { | |
body: 'body' | |
}, |
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
/*global jQuery */ | |
/*jshint bitwise: true, camelcase: true, curly: true, eqeqeq: true, forin: true, | |
immed: true, indent: 4, latedef: true, newcap: true, nonew: true, quotmark: single, | |
undef: true, unused: true, strict: true, trailing: true, browser: true */ | |
(function ($) { | |
'use strict'; | |
$.fn.serializeObject = function () { |
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
<!doctype html> | |
<html> | |
<head> | |
<title> | |
Event order | |
</title> | |
<style type="text/css"> | |
* { | |
margin: 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
.box { | |
display: block; | |
background: red; | |
width: 200px; | |
height: 200px; | |
opacity: 1; | |
} | |
.box-hidden { | |
display: none; |
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
/* | |
* invokes 'focusout' / 'blur' type effect on any element | |
* | |
* NOTE: binds to html element so ensure namespace is passed in for manual unbinding. | |
*/ | |
(function ($, undefined) { | |
var defaults = { | |
namespace: 'clickOutside', // namespace to unbind at later time (currently manual) |
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 MyCollectionView = Backbone.View.extend({ | |
initialize: function() { | |
this.listenTo(this.collection, 'request', this.showLoader); | |
this.listenTo(this.collection, 'reset', this.render); | |
this.listenTo(this.collection, 'add', this.renderItem); | |
this.listenTo(this.collection, 'remove', this.removeItem); | |
if (this.collection.isReady()) { | |
this.render(); | |
} else { |
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
/* $margin-large: 28px === desired margin from baseline. */ | |
/* $margin-medium: 16px === desired margin from baseline. */ | |
/* $margin-small: 8px === desired margin from baseline. */ | |
.base { | |
/* line-height adds 16px(!) to bottom of heading */ | |
line-height: 1.5; | |
font-size: 40px; | |
} |
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
'use strict'; | |
// http://stackoverflow.com/questions/31089801/extending-error-in-javascript-with-es6-syntax | |
class ExtendableError extends Error { | |
constructor(message) { | |
super(); | |
this.message = message; | |
this.stack = (new Error()).stack; | |
this.name = this.constructor.name; | |
} |
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
'use strict'; | |
/** | |
* Validators are functions accepting `state` and `prop` where `state` is an object | |
* containing the entire form state, e.g. `{ email: 'email', password: 'password' }` | |
* and `prop` refers to the property on `state` to be validated. | |
* | |
* Validators are expected to return a falsy value if valid and a truthy value if | |
* invalid. This is to allow information re: the error to be returned. e.g. | |
* |
OlderNewer