One of the premises of WebAssembly is to support compiling multiple languages to WebAssembly.
| ### JHW 2018 | |
| import numpy as np | |
| import umap | |
| # This code from the excellent module at: | |
| # https://stackoverflow.com/questions/4643647/fast-prime-factorization-module | |
| import random |
via: http://www.webupd8.org/2011/05/install-firefox-nightly-from-ubuntu-ppa.html
Add the Mozilla Daily PPA (available for Ubuntu 11.04, 10.10 and 10.04) and install Firefox Nightly using the commands below:
$ [sudo] add-apt-repository ppa:ubuntu-mozilla-daily/ppa
$ [sudo] apt-get update
$ [sudo] apt-get install firefox-trunkSince this is a daily builds PPA, it's nowhere near stable so use it at your own risk!
| <html> | |
| <head> | |
| <title>DevTools Test</title> | |
| </head> | |
| <body> | |
| <script> | |
| if ('serviceWorker' in navigator) { | |
| navigator.serviceWorker.register('sw.js'); | |
| // Wait until the SW has taken control of the page before inserting the <script> elements. | |
| // That way we can be sure the SW's fetch handler will intercept them. |
| { | |
| "firebase": "my-awesome-app", | |
| "rewrites": [ { | |
| "source": "**", | |
| "destination": "/index.html" | |
| } ], | |
| "headers": [ { | |
| "source" : "**/*.html", | |
| "headers" : [ { | |
| "key" : "Cache-Control", |
| // === Arrays | |
| var [a, b] = [1, 2]; | |
| console.log(a, b); | |
| //=> 1 2 | |
| // Use from functions, only select from pattern | |
| var foo = () => [1, 2, 3]; |
| // Good | |
| exports.sendEmail = functions.auth.user().onCreate(event => { | |
| const mailgun = require('mailgun-js'); | |
| // ... | |
| }); | |
| // Not As Awesome | |
| const mailgun = require('mailgun-js'); | |
| exports.sendEmail = functions.auth.user().onCreate(event => { |
| // Client-side code, in my case a web browser | |
| firebase.auth().onAuthStateChanged(function (user) { | |
| this.user = user; // Set my local copy of the 'user' object | |
| if (user) { | |
| this.displayName = user.displayName; | |
| this.photoURL = user.photoURL; | |
| var userRef = firebase.database().ref('queues/login').child(user.uid); | |
| userRef.remove() | |
| .then(function () { |
| const function = require('firebase-functions'); | |
| functions.database.ref('queues/login/{uid}').onWrite(event => { | |
| const config = functions.config(); | |
| // functions.config() returns your environment variables. | |
| // In this case I have an array of my admin users' email addresses in accessControlLists.adminUsers | |
| // It looks like ['chris@chrisesplin.com', 'some-other-admin@chrisesplin.com'] | |
| const adminUsersString = config.['access-control-lists']['admin-users']; | |
| const adminUsers = adminUsersString.split(','); | |
| const user = event.data.val(); |
Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist.
Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).