- Fig - Fast, isolated development environments using Docker
- Packer - Tool for creating identical machine images
- decking - Create, manage and run clusters of Docker containers
- Ansible
- Kubernetes - Container Cluster Manager
#!/bin/bash | |
# Assumes a pre-built carina cluster, e.g.: | |
# | |
# carina create --wait shipyard \ | |
# && carina credentials shipyard \ | |
# && eval `carina env shipyard` | |
# |
def main(): | |
while True: | |
try: | |
pokemon = int(input("How many Pokemon do you have? ")) | |
if pokemon >= 0: | |
break | |
raise ValueError | |
except ValueError: | |
print("Invalid number") |
import React, { Component } from 'react'; | |
import './valueInspector.less'; | |
import Immutable from 'immutable'; | |
export default class ValueInspector extends Component | |
{ | |
render() { | |
let referenceTracker = new CircularReferenceTracker(); | |
let path = Immutable.List(); |
A "choose your own adventure" story
JavaScript is has both object-oriented and functional heritage, thanks to its two parents: Scheme and Self.
It provides first class functions and makes it simple to compose these function objects into bundles of awesome. Even though I'm an OO "true believer" at heart, I find myself composing my code using functional concepts, and use the OO approach where there's a clear benefit or where I feel that it's the best way to communicate the interface.
Object-oriented software design is by no means the only way to do software design, but it's been an immensely successful model for a very long time now, and provides a clear and well-understood mental model for thinking and communicating about software. Lots of good ideas like encapsulation, delegation, traits and composition fit well into OO design.
#!/usr/bin/env node | |
/* | |
Use the Yahoo Finance CSV API to do some basic market research calculations. | |
- Background: http://greenido.wordpress.com/2009/12/22/yahoo-finance-hidden-api/ | |
- Example URL: http://finance.yahoo.com/d/quotes.csv?s=GOOG+FB+AAPL&f=snj1pr | |
s: Symbol | |
n: Name | |
j1: Market Capitalization (in billions) | |
p: Price-per-share (at previous close) |
#!/usr/bin/env node | |
/* | |
Use the Yahoo Finance CSV API to do some basic market research calculations. | |
- Background: http://greenido.wordpress.com/2009/12/22/yahoo-finance-hidden-api/ | |
- Example URL: http://finance.yahoo.com/d/quotes.csv?s=GOOG+FB+AAPL&f=snj1pr | |
s: Symbol | |
n: Name | |
j1: Market Capitalization (in billions) | |
p: Price-per-share (at previous close) |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
#!/bin/bash | |
sudo docker build -t $JOB_NAME/$BUILD_NUMBER . | |
DB_NAME="/$JOB_NAME-$BUILD_NUMBER-db" | |
DB_CONTAINER=$(sudo docker run -d -name $DB_NAME <private repository URL>/database-schema) | |
sudo docker run -link $DB_NAME:db -t $JOB_NAME/$BUILD_NUMBER nosetests | |
sudo docker tag $JOB_NAME/$BUILD_NUMBER <private repository URL>/${JOB_NAME}-master | |
sudo docker push <private repository URL>/${JOB_NAME}-master >/dev/null | |
sudo docker kill ... | |
sudo docker rm ... | |
sudo docker rmi ... |
import axios from 'axios' | |
function api(user, pass) { | |
return axios.create({ | |
'X-User':user, | |
'X-Password':pass | |
}) | |
} | |