To force running under JDK 1.7 edit /Applications/.app/Contents/Info.plist file, change JVMVersion from 1.6* to 1.7* :
<key>JVMVersion</key>
<string>1.7*</string>To force running under JDK 1.7 edit /Applications/.app/Contents/Info.plist file, change JVMVersion from 1.6* to 1.7* :
<key>JVMVersion</key>
<string>1.7*</string>| (function() { | |
| var wrapper = document.createElement('div'); | |
| var jsonml = [ | |
| ['p', 'dette er kun tekst'], | |
| ['p', 'dette er', [ 'strong', 'bold' ], 'tekst'], | |
| ['p', 'dette er enda en linje med en', ['a', { 'href' : 'http://www.ba.no' }, 'link']] | |
| ]; |
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |
First define the margin object with properties for the four sides (clockwise from the top, as in CSS).
var margin = {top: 20, right: 10, bottom: 20, left: 10};
Then define width and height as the inner dimensions of the chart area.
var width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
Lastly, define svg as a G element that translates the origin to the top-left corner of the chart area.
| var tag = document.createElement.bind(document), | |
| txt = document.createTextNode.bind(document), | |
| get = document.querySelector.bind(document), | |
| getall = document.querySelectorAll.bind(document), | |
| log = console.log.bind(console); |
The question: how can we use ES6 modules in Node.js, where modules-as-functions is very common? That is, given a future in which V8 supports ES6 modules:
export syntax, without breaking consumers that do require("function-module")()?import syntax, while not demanding that the module author rewrites his code to ES6 export?@wycats showed me a solution. It involves hooking into the loader API to do some rewriting, and using a distinguished name for the single export.
This is me eating crow for lots of false statements I've made all over Twitter today. Here it goes.
| /* | |
| Quick and easy way to write inline styles in js | |
| setAttribute is not used to avoid overwriting the styles attribute if present on the element | |
| Implies you’re inside a constructor where this.el is the element to be styled | |
| */ | |
| var styles = [ | |
| ['width', '100%'], | |
| ['height', '100%'], | |
| ['background', 'orange'] |
| //<p class="txt-m">Congrats, <span class="icon icon--goldMedal" aria-hidden="true"></span> First place!</p> | |
| [ 'p', { 'class' : 'txt-m' }, 'Congrats, ', | |
| [ 'span', { 'class' : 'icon icon--goldMedal', 'aria-hidden' : 'true' } ], | |
| 'First place!' | |
| ] |