Real unit test (isolation, no children render)
Calls:
- constructor
- render
| import java.lang.reflect.UndeclaredThrowableException; | |
| import java.security.GeneralSecurityException; | |
| import java.text.DateFormat; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Date; | |
| import javax.crypto.Mac; | |
| import javax.crypto.spec.SecretKeySpec; | |
| import java.math.BigInteger; | |
| import java.util.TimeZone; |
| // curl -X POST -H "Content-Type: application/octet-stream" --data-binary '@filename' http://127.0.0.1:5050/upload | |
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "net/http" | |
| "os" | |
| "time" |
So migrating my existing app wasn't as troublesome as I originally thought. First thing I did was take a look at my router and routes
and figure try to make a mental model of all the files where I had nested routes in the existing app because those components/containers will contain {this.props.children}. So I need to replace those with the nested <Match /> components.
So just to give an example:
<Router history={history}>
<Route path="/" component={App}>I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
| const gulp = require('gulp'), | |
| util = require('gulp-util'), | |
| notifier = require('node-notifier'), | |
| sync = require('gulp-sync')(gulp).sync, | |
| reload = require('gulp-livereload'), | |
| child = require('child_process'), | |
| os = require('os'); | |
| var server = null; |
| /** | |
| * This code is licensed under the terms of the MIT license | |
| * | |
| * Deep diff between two object, using lodash | |
| * @param {Object} object Object compared | |
| * @param {Object} base Object to compare with | |
| * @return {Object} Return a new object who represent the diff | |
| */ | |
| function difference(object, base) { | |
| function changes(object, base) { |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE hibernate-configuration PUBLIC | |
| "-//Hibernate/Hibernate Configuration DTD 3.0//EN" | |
| "http://hibernate.org/dtd/hibernate-configuration-3.0.dtd"> | |
| <hibernate-configuration> | |
| <session-factory> | |
| <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> | |
| <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/Book</property> | |
| <property name="hibernate.connection.username">root</property> | |
| <property name="hibernate.connection.password"></property> |
| var multiply = function() { | |
| var _args = [].slice.call(arguments); | |
| var length = _args.length; | |
| if (Array.isArray(this)) { | |
| this.push(_args.pop()); | |
| if (this.length === 3) { | |
| return (this[0] * this[1] * this[2]); | |
| } |