Set the base image to Ubuntu must be first instruction - use docker search to find images
FROM ubuntu # <image>
FROM ubuntu:latest # - <image>:<tag>
FROM ubuntu:precise (LTS)Set the maintainer info
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "syscall" | |
| ) | |
| func main() { |
| package main | |
| import ( | |
| "bufio" | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "crypto/rand" | |
| "fmt" | |
| "io" | |
| "io/ioutil" |
Set the base image to Ubuntu must be first instruction - use docker search to find images
FROM ubuntu # <image>
FROM ubuntu:latest # - <image>:<tag>
FROM ubuntu:precise (LTS)Set the maintainer info
| // Get binary file using XMLHttpRequest | |
| function getBinary(file) { | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open("GET", file, false); | |
| xhr.overrideMimeType("text/plain; charset=x-user-defined"); | |
| xhr.send(null); | |
| return xhr.responseText; | |
| } | |
| // Base64 encode binary string |
| /* | |
| To convert mins into hrs | |
| */ | |
| let minToHm = (m) => { | |
| let h = Math.floor(m / 60); | |
| h += (h < 0) ? 1 : 0; | |
| let m2 = Math.abs(m % 60); | |
| m2 = (m2 < 10) ? '0' + m2 : m2; | |
| return (h < 0 ? '' : '+') + h + ':' + m2; |
| // To get path by slate element | |
| const path = ReactEditor.findPath(editor, props.element) | |
| // search node at path example | |
| export const getNodeAtPath = (editor: any, path: any) => { | |
| const [node] = Editor.node(editor, path); | |
| return node; | |
| }; | |
| export const getImage = (editor: any, path: any, id: any): any => { |
| Set response status via numeric code: | |
| 100 "continue" | |
| 101 "switching protocols" | |
| 102 "processing" | |
| 200 "ok" | |
| 201 "created" | |
| 202 "accepted" | |
| 203 "non-authoritative information" | |
| 204 "no content" |
| // Copyright (c) 2012 Sutoiku, Inc. (MIT License) | |
| // Some algorithms have been ported from Apache OpenOffice: | |
| /************************************************************** | |
| * | |
| * Licensed to the Apache Software Foundation (ASF) under one | |
| * or more contributor license agreements. See the NOTICE file | |
| * distributed with this work for additional information | |
| * regarding copyright ownership. The ASF licenses this file |
| import React from "react"; | |
| // Default contatiner style | |
| const defStyle = { | |
| width: "60px", | |
| height: "60px", | |
| border: "1px solid", | |
| borderColor: "#eee", | |
| borderRadius: "50%", | |
| backgroundColor: "red", |
| // Rounding Decimals in JavaScript | |
| /* | |
| Rounding Errors | |
| The most common solutions for rounding to a decimal place is to either use Number.prototype.toFixed(), or multiply the float by some power of 10 in order to leverage Math.round(). Both of these work, except sometimes a decimal of 5 is rounded down instead of up. | |
| */ | |
| // First Methods |