The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.
It uses Open Source tools that are widely available, tested and understood:
- Node.JS
- NPM
- Express
module Data.List.Permute where | |
permute :: [a] -> [[a]] | |
permute [] = [[]] | |
permute xs = let picks = pick xs | |
f (x, xs') = map (x:) (permute xs') | |
in concatMap f picks | |
pick :: [a] -> [(a, [a])] | |
pick [] = [] |
module Data.Tree where | |
import Data.List (sortBy) | |
import Data.Ord (comparing) | |
data Tree a = Tip | Node a (Tree a) (Tree a) | |
deriving (Show, Eq) | |
-- x, y | |
type Coords = (Int, Int) |
/////////////////////////////////////////////////////////// | |
// shortest: immutable data container with public data // | |
/////////////////////////////////////////////////////////// | |
public class Contact { | |
public final Name name; | |
public final Address address; | |
public final PhoneNumber phoneNumber; | |
public final Email email; | |
public Contact(Name n, Address a, PhoneNumber p, Email em) { |
The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.
It uses Open Source tools that are widely available, tested and understood:
import java.util.*; | |
class MapDiff { | |
public static void main(String[] args) { | |
Map<String, Integer> m1 = new HashMap<String, Integer>(); | |
m1.put("a", 1); | |
m1.put("b", 2); | |
m1.put("c", 3); | |
Map<String, Integer> m2 = new HashMap<String, Integer>(); |
from flask import abort, make_response, jsonify | |
abort(make_response(jsonify(message="Message goes here"), 400)) |
eg() { | |
tmpfile=$(mktemp -t gist) | |
filename=${1:-$(basename $tmpfile)} | |
$EDITOR $tmpfile | |
if [ -s $tmpfile ] | |
then | |
gist -c -f $filename $tmpfile | |
fi | |
rm -f $tmpfile | |
} |
class MyData { ... } | |
class YourData { ... } | |
abstract class Generic<T> { | |
public T tObject; | |
// constructor takes a T, whatever it is | |
public Generic(T tObject) { this.tObject = tObject; } | |
public abstract T giveMeTheT(); |
$ docker --version Docker version 1.9.1, build a34a1d5
$ sudo mkdir -p /etc/resolver >/dev/null 2>&1
$ echo nameserver 172.17.0.1 | sudo tee /etc/resolver/docker > /dev/null
$ sudo route -n delete -net 172.17.0.0
$ sudo route -n add 172.17.0.0/16 $(docker-machine ip default)
$ sudo route -n add 172.17.0.1/32 $(docker-machine ip default)
$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
module Nat where | |
import Prelude hiding (succ) | |
import Control.Monad (forM_) | |
data Even = Zero | EvenSucc Odd | |
deriving (Show, Eq) | |
data Odd = OddSucc Even | |
deriving (Show, Eq) |