- use the
0b
prefix for binary, and the0o
prefix for octal integer literals Number.isNaN
andNumber.isFinite
are like their global namesakes, except that they don’t coerce the argument to NumberNumber.parseInt
andNumber.parseFloat
are exactly the same as their global namesakes- use
Number.isInteger
to check if the argument is a Number value that doesn’t have a decimal part - use
Number.EPSILON
to check if the difference between two Number values is negligible (e.g. the difference between0.1 + 0.2
and0.3
is negligible) Number.MAX_SAFE_INTEGER
andNumber.MIN_SAFE_INTEGER
are the largest and smallest integers that can be safely and precisely represented in JavaScript- use
Number.isSafeInteger
to check if an integer is within those bounds
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 gulp = require('gulp'); | |
// server | |
var server = require('gulp-express'); | |
var livereload = require('gulp-livereload'); | |
// css | |
var stylus = require('gulp-stylus'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var minify = require('gulp-minify-css'); | |
// js | |
var browserify = require('gulp-browserify'); |
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 $ = jQuery; | |
// Config = selectors for UL (tabs) and SECTION (panel) elements + which tab should be selected on init | |
var $list = $('.topbar__tabs'); | |
var $sections = $('.tabbed-section'); | |
var selected_index = 1; | |
// Caching the LI and A elements since they’ll be heavily used in the code |
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 $ = jQuery; | |
var $list = $('.topbar__tabs'); | |
var $sections = $('.tabbed-section'); | |
var selected_index = 0; | |
var $items = $list.children('li'); | |
var $anchors = $list.find('a'); | |
// The setup |
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
default-src | |
'self' | |
; | |
script-src | |
'self' | |
https://a.disquscdn.com/ | |
https://hashtagsecurity.disqus.com | |
code.jquery.com | |
; | |
img-src |
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
http://g-ecx.images-amazon.com/*/AiryBasicRenderer*.swf | |
http://z-ecx.images-amazon.com/*/AiryFlashlsRenderer._TTW_.swf | |
http://ia.media-imdb.com/*/AiryFlashlsRenderer._TTW_.swf |
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
// Paste this into the browser’s JavaScript console | |
function walkTheDOM(node, func) { | |
func(node); | |
node = node.firstChild; | |
while (node) { | |
walkTheDOM(node, func); | |
node = node.nextSibling; | |
} | |
} |
Articles about flexbox:
- “Old” Flexbox and “New” Flexbox by Chris Coyier (August 2012)
- Flexbox — fast track to layout nirvana? by Cris Mills (October 2012)
- Dive into Flexbox by Greg Smith (December 2012)
- Flexbox syntax for IE 10 by Zoe Gillenwater (February 2013)
- Using Flexbox: Mixing Old and New for the Best Browser Support by Chris Coyier (February 2013)
- Working with flexbox: The new specification by Steven Bradley (March 2013)
- Advanced cross-browser flexbox by Chris Mills (April 2013)
- [Animating flexboxes: the lowdown](http://dev.opera.com/articles/view/animating-flexboxes-the-lowdown
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
<head> | |
<script>document.write('<meta charset="utf-8">')</script> | |
</head> | |
<body> | |
<script> | |
document.body.innerHTML += "✓"; | |
</script> | |
</body> |
I did a quick poll in 4 chat rooms:
http://chat.stackoverflow.com/transcript/message/11867788#11867788
http://chat.stackoverflow.com/transcript/message/11867799#11867799
http://chat.stackoverflow.com/transcript/message/11867796#11867796
http://chat.stackoverflow.com/transcript/message/11867794#11867794
The response: People tend to agree with me that they would like have the code block fully expanded, or at least with an option to fully expand.
I'd add an "expand" toggle below the code block: