Interpolating between things using lerp.
function lerp (start, end, t) {
return start * (1 - t) + end * t;
}This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
| import * as React from 'react'; | |
| import { mount } from 'enzyme'; | |
| import sinon from 'sinon'; | |
| function isImageLoaded(img: HTMLImageElement) { | |
| return img.complete && img.naturalHeight > 0; | |
| } | |
| type Props = { | |
| src: string, |
| //@flow | |
| import React, { Component } from 'react' | |
| import type { ElementRef } from 'react' | |
| type Props = { src: string, alt: string } | |
| type State = { source?: string } | |
| export default class LazyImage extends Component<Props, State> { | |
| state = {} |
| '.source.go': | |
| 'Options': | |
| 'prefix': 'options' | |
| 'body': ''' | |
| // Option function. | |
| type Option func(*$1) | |
| // New with the given options. | |
| func New(options ...Option) *$1 { |
| # do https://gist.github.com/jed/6147872 and then do this to proxy your app | |
| worker_processes 1; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| server { | |
| listen 80; |
| // 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
| const axios = require('axios'); // promised based requests - like fetch() | |
| function getCoffee() { | |
| return new Promise(resolve => { | |
| setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
| }); | |
| } |
| docker logs nginx 2>&1 | grep "127." | |
| # ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container |
UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).
If you are getting the error: No space left on device
Configuring the qcow2 size cap is possible in the current versions:
# my disk is currently 64GiB