How to install Node.js on Chrome Os.
- Chrome Os running in Developer Mode.
- crouton (Chromium OS Universal Chroot Environment).
When not in Developer Mode check the official chromium poking-around-your-chrome-os-device page.
When not in Developer Mode check the official chromium poking-around-your-chrome-os-device page.
Using Upperdog Interactive’s CSS Twitter logo as reference, and I wrote some circle-circle intersection code (a.k.a. math) to specify the Twitter logo as sequence of elliptical arc segments. There are other versions of the Twitter logo in SVG, but as best I can tell, they use cubic Béziers. I found it mathematically unsettling to use Béziers when circular arcs would suffice.
| (function(document) { | |
| 'use strict'; | |
| // Feature detection | |
| // Check if Web Components are supported | |
| var webComponentsSupported = ('registerElement' in document | |
| && 'import' in document.createElement('link') | |
| && 'content' in document.createElement('template')); | |
| // Load Web Components when not supported | |
| if (!webComponentsSupported) { |
| // uppercase the first letter | |
| String.prototype.firstToUpperCase = function() { | |
| return this.charAt(0).toUpperCase() + this.substr(1); | |
| } |
| function import(href, options) { | |
| var link = document.createElement('link'); | |
| var target = options.target ? options.target : document.head; | |
| if (options.async) { | |
| link.setAttribute('async', ''); | |
| } | |
| link.rel = 'import'; | |
| link.href = href; | |
| target.appendChild(link); | |
| } |
This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.
You want a script that does a local compile to e.g. an out/ directory. Let's call this compile.sh for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.
The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.
| /*! | |
| * Copyright 2015 Google Inc. All rights reserved. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| # Version key/value should be on his own line | |
| PACKAGE_VERSION=$(cat package.json \ | |
| | grep version \ | |
| | head -1 \ | |
| | awk -F: '{ print $2 }' \ | |
| | sed 's/[",]//g') | |
| echo $PACKAGE_VERSION |
| const image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABH0lEQVRYhWN0jUr5zzCAgGkgLWdgYGBgoUTzrqWzKXYA44iPglEHjDpg1AGjDhh1wIA7gKLaEBewNjFkCPf1YPj05StDTfckrGpignwZgj1daRMCAe7ODKqK8gysLNj9Z6qvw+BmZ8Wwafd+2jigtLWH4dL1WzjlzQ30GH7/+cOw69Ax2kQBNmCko8VQkp7AcOLcJQZJMRGGT5+/Mjx98ZJ+ifDclWsMUbllDJPmL2FgYmJi+PXrFwMDwwDlgn///sHZA+KApy9eMQgK8DNwcrAPjANOXrjEwMHOxhDh58XArKxr1EBtCzorixgMdTQZJMVEGXTUVRn2HDnOYKSjxdBbW8ogLSHOsH7HHgY+Hh6GYC/X0VbxqANGHTDwDgAA+4tGGj9PrTsAAAAASUVORK5CYII=' | |
| const regex = /^data:.+\/(.+);base64,(.*)$/; | |
| const matches = image.match(regex); | |
| const extension = matches[1]; | |
| const data = matches[2]; | |
| const buffer = new Buffer(data, 'base64'); // write, stream, something ... |
| <html> | |
| <head> | |
| <script type="module"> | |
| window.imports = true; | |
| import './app-shell-es.js'; | |
| </script> | |
| <script src="app-shell.js" nomodule></script> | |
| </head> | |
| </html> |