Good documentation should include two distinct elements - a Guide and an API:
- The Guide builds concepts, providing examples, etc.
GitBook is well suited to
| # -*- coding: utf-8 -*- | |
| u""" | |
| Beta regression for modeling rates and proportions. | |
| References | |
| ---------- | |
| Grün, Bettina, Ioannis Kosmidis, and Achim Zeileis. Extended beta regression | |
| in R: Shaken, stirred, mixed, and partitioned. No. 2011-22. Working Papers in | |
| Economics and Statistics, 2011. |
| // Open-ended range operators | |
| // | |
| // 100... is equivalent to 100...Int.max | |
| // ...-100 is equivalent to Int.min...-100 | |
| // ..<3 is equivalent to Int.min..<3 | |
| import Swift | |
| /// Conforming types provide static `max` and `min` constants. | |
| protocol MinMaxType { |
| var initalArray = [1, 2, 3] | |
| let pointer: UnsafeMutablePointer<Int> = UnsafeMutablePointer(initalArray) | |
| let arrary = Array(UnsafeBufferPointer(start: pointer, count: initalArray.count)) |
| # -*- coding: utf-8 -*- | |
| import sys | |
| import numpy | |
| numpy.seterr(all='ignore') | |
| ''' |
| import Foundation | |
| public protocol AlmostEquatable { | |
| @warn_unused_result | |
| func ==~(lhs: Self, rhs: Self) -> Bool | |
| } | |
| public protocol EquatableWithinEpsilon: Strideable { | |
| static var Epsilon: Self.Stride { get } | |
| } |
| /** | |
| * Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt(). | |
| * (c) Chris Veness MIT Licence | |
| * | |
| * @param {String} plaintext - Plaintext to be encrypted. | |
| * @param {String} password - Password to use to encrypt plaintext. | |
| * @returns {String} Encrypted ciphertext. | |
| * | |
| * @example | |
| * const ciphertext = await aesGcmEncrypt('my secret text', 'pw'); |
Good documentation should include two distinct elements - a Guide and an API:
GitBook is well suited to
| /* | |
| Author: Jonathan Lurie - http://me.jonathanlurie.fr | |
| License: MIT | |
| The point of this little gist is to fix the issue of losing | |
| typed arrays when calling the default JSON serilization. | |
| The default mode has for effect to convert typed arrays into | |
| object like that: {0: 0.1, 1: 0.2, 2: 0.3} what used to be | |
| Float32Array([0.1, 0.2, 0.3]) and once it takes the shape of an | |
| object, there is no way to get it back in an automated way! |
| // Simple example of how to display an image from IPFS on your html web page | |
| // Using ipfs/js-ipfs : https://github.com/ipfs/js-ipfs#use-in-the-browser | |
| // Don't forget to include the scripts into your html page: | |
| // <script src="https://unpkg.com/ipfs/dist/index.min.js"></script> | |
| // <script src="https://cdn.jsdelivr.net/npm/ipfs/dist/index.min.js"></script> | |
| function showIPFSImage () { | |
| // Create the IPFS node instance | |
| const node = new Ipfs() |
| package main | |
| import ( | |
| "fmt" | |
| "github.com/ethereum/go-ethereum/accounts" | |
| "github.com/ethereum/go-ethereum/common/hexutil" | |
| "github.com/ethereum/go-ethereum/crypto" | |
| ) |