This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const TEST_OVERFLOW = /(auto|scroll)/; | |
/** | |
* Scrolls to an element by scrolling it's parent scroll container. | |
* | |
* @param {Element} element The element to scroll to | |
* @param {boolean} [center] Whether to center the element within it's scroll container | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* Resize an image (from URL). Ensures that the images is contained within the bounding box. | |
* | |
* @param {string} url The image URL | |
* @param {number} width The maximum image width | |
* @param {number} height The maximum image height | |
* @param {boolean} [padding] Whether to include padding if the image doesn't fit perfectly | |
* @returns {Promise<string>} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* JS scoping, and this property resolutions rules in ES7/ES8. | |
* | |
* Quiz: x is gone, and x is everywhere! | |
* | |
* Help find Xs! What's the output? | |
*/ | |
let x = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"1": "Bulbasaur", | |
"2": "Ivysaur", | |
"3": "Venusaur", | |
"4": "Charmander", | |
"5": "Charmeleon", | |
"6": "Charizard", | |
"7": "Squirtle", | |
"8": "Wartortle", | |
"9": "Blastoise", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################## INSTRUCTIONS ################################## | |
# 1. Make sure docker-machine is installed on your machine # | |
# 2. Download the file # | |
# 3. Run using $ . swarm-with-docker-machine.sh so that DOCKER_HOST is exported # | |
################################################################################## | |
# Clean any existing machines | |
yes | docker-machine rm manager | |
yes | docker-machine rm agent1 | |
yes | docker-machine rm agent2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker-machine create -d virtualbox swarm-manager | |
manager_ip=$(docker-machine ip swarm-manager) | |
manager_config=$(docker-machine config swarm-manager) | |
docker-machine create -d virtualbox swarm-agent-1 | |
agent1_ip=$(docker-machine ip swarm-agent-1) | |
agent1_config=$(docker-machine config swarm-agent-1) | |
docker-machine create -d virtualbox swarm-agent-2 | |
agent2_ip=$(docker-machine ip swarm-agent-2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker-machine create \ | |
--driver=digitalocean \ | |
--digitalocean-access-token=$DO_TOKEN \ | |
--digitalocean-size=512mb \ | |
--digitalocean-region=nyc3 \ | |
--digitalocean-private-networking=true \ | |
--digitalocean-image=ubuntu-15-04-x64 \ | |
docker-swarm-kv-store | |
docker $(docker-machine config docker-swarm-kv-store) run -d \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
) | |
func main() { | |
askCommand := flag.NewFlagSet("ask", flag.ExitOnError) |