#### Date
-| Example | Output |
-| --- | --- |
-| `YYYY-MM-DD` | `2014-01-01` |
-| `dddd, MMMM Do YYYY` | `Friday, May 16th 2014` |
-{: .-shortcuts}
+| Example | Output |
+| ------------------------- | ---------------------- |
+| `YYYY-MM-DD` | 2014-01-01 |
+| `dddd, MMMM Do YYYY` | Friday, May 16th 2014 |
+| `dddd [the] Do [of] MMMM` | Friday the 16th of May |
#### Time
-| Example | Output |
-| --- | --- |
-| `hh:mm a` | `12:30 pm` |
-{: .-shortcuts}
+| Example | Output |
+| --------- | -------- |
+| `hh:mm a` | 12:30 pm |
Used by [Moment.js](http://momentjs.com/docs/#/displaying/) and [date-fns/format](https://date-fns.org/v1.28.5/docs/format). Similar to Java [SimpleDateFormat](https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html).
### Presets
-| Example | Output |
-| --- | --- |
-| `LT` | `8:30 PM` |
-| `LTS` | `8:30:25 PM` |
-| --- | --- |
-| `LL` | `August 2 1985` |
-| `ll` | `Aug 2 1985` |
-| --- | --- |
-| `LLL` | `August 2 1985 08:30 PM` |
-| `lll` | `Aug 2 1985 08:30 PM` |
-| --- | --- |
-| `LLLL` | `Thursday, August 2 1985 08:30 PM` |
-| `llll` | `Thu, Aug 2 1985 08:30 PM` |
-{: .-shortcuts}
+| Example | Output |
+| ------- | -------------------------------- |
+| `LT` | 8:30 PM |
+| `LTS` | 8:30:25 PM |
+| --- | --- |
+| `LL` | August 2 1985 |
+| `ll` | Aug 2 1985 |
+| --- | --- |
+| `LLL` | August 2 1985 08:30 PM |
+| `lll` | Aug 2 1985 08:30 PM |
+| --- | --- |
+| `LLLL` | Thursday, August 2 1985 08:30 PM |
+| `llll` | Thu, Aug 2 1985 08:30 PM |
```
```bash
-$((RANDOM%=200)) # Random number 0..200
+$(($RANDOM%200)) # Random number 0..199
```
### Subshells
This command changes both the `composer.json` and `composer.lock` files.
+### Passing versions
+
+| Command | Description |
+| ----------------------------------------------- | ---------------------------------------- |
+| `composer require vendor/pkg "1.3.2"` | Installs `1.3.2` |
+| `composer require vendor/pkg ">=1.3.2"` | Above or equal `1.3.2` |
+| `composer require vendor/pkg "<1.3.2"` | Below `1.3.2` |
+| `composer require vendor/pkg "1.3.*"` | Latest of `>=1.3.0 <1.4.0` |
+| `composer require vendor/pkg "~1.3.2"` | Latest of `>=1.3.2 <1.4.0` |
+| `composer require vendor/pkg "~1.3"` | Latest of `>=1.3.0 <2.0.0` |
+| `composer require vendor/pkg "^1.3.2"` | Latest of `>=1.3.2 <2.0.0` |
+| `composer require vendor/pkg "^1.3"` | Latest of `>=1.3.0 <2.0.0` |
+| `composer require vendor/pkg "^0.3.2"` | Latest of `>=0.3.0 <0.4.0` (for pre-1.0) |
+| `composer require vendor/pkg "dev-BRANCH_NAME"` | From the branch `BRANCH_NAME` |
+
### Removing packages
| Command | Description |
-i, --interactive # attach stdin (interactive)
-t, --tty # pseudo-tty
--name NAME # name your image
- -p, --publish 5000:5000 # port map
+ -p, --publish 5000:5000 # port map (host:container)
--expose 5432 # expose a port to linked containers
-P, --publish-all # publish all ports
--link container:alias # linking
```
{: data-line="2"}
-See: [Dynamic object keys](https://flow.org/docs/objects.html#objects-as-maps)
+See: [Dynamic object keys](https://flow.org/en/docs/types/objects/#toc-objects-as-maps)
## Advanced features
type Country = $Keys<typeof countries>
```
-See: [Enums](https://flow.org/docs/utility-types.html#keyst)
+See: [Enums](https://flow.org/en/docs/types/utilities/#toc-keys)
### Type aliases
}
```
-See: [Type aliases](https://flow.org/docs/quick-reference.html#type-aliases)
+See: [Type aliases](https://flow.org/en/docs/types/aliases/)
### Generic classes
var n: GenericClass<number> = new GenericClass(0)
```
-See: [Generic classes](https://flow.org/docs/quick-reference.html#generics)
+See: [Generic classes](https://flow.org/en/docs/types/generics/#toc-classes-with-generics)
### Interfaces
(new Foo: Jsonable)
```
-See: [Interfaces](https://flow.org/docs/quick-reference.html#interfaces)
+See: [Interfaces](https://flow.org/en/docs/types/interfaces/)
### Functions
}
```
-See: [Functions](https://flow.org/docs/functions.html)
+See: [Functions](https://flow.org/en/docs/types/functions/)
### Imports
### Statements in if
```go
-if _, err := getResult(); err != nil {
+if _, err := doThing(); err != nil {
fmt.Println("Uh oh")
}
```
{: data-line="1"}
-A condition in an `if` statement can be preceded with a statement before a `;`.
+A condition in an `if` statement can be preceded with a statement before a `;`. Variables declared by the statement are only in scope until the end of the `if`.
See: [If with a short statement](https://tour.golang.org/flowcontrol/6)
See: [Pointer receivers](https://tour.golang.org/methods/4)
+## Interfaces
+
+### A basic interface
+
+```go
+type Shape interface {
+ Area() float64
+ Perimeter() float64
+}
+```
+
+### Struct
+
+```go
+type Rectangle struct {
+ Length, Width float64
+}
+```
+
+Struct `Rectangle` implicitly implements interface `Shape` by implementing all of its methods.
+
+### Methods
+
+```go
+func (r Rectangle) Area() float64 {
+ return r.Length * r.Width
+}
+
+func (r Rectangle) Perimeter() float64 {
+ return 2 * (r.Length + r.Width)
+}
+```
+
+The methods defined in `Shape` are implemented in `Rectangle`.
+
+### Interface example
+
+```go
+func main() {
+ var r Shape = Rectangle{Length: 3, Width: 4}
+ fmt.Printf("Type of r: %T, Area: %v, Perimeter: %v.", r, r.Area(), r.Perimeter())
+}
+```
+
## References
### Official resources
}
```
-See: <http://usejsdoc.org/index.html>
+See: <https://jsdoc.app/index.html>
### Types
| `@param {string[]} n` | Array of strings |
| `@return {Promise<string[]>} n` | Promise fulfilled by array of strings |
-See: <http://usejsdoc.org/tags-type.html>
+See: <https://jsdoc.app/tags-type.html>
### Variables
function play(song) {}
```
-See: <http://usejsdoc.org/tags-typedef.html>
+See: <https://jsdoc.app/tags-typedef.html>
### Typedef Shorthand
function play(song) {}
```
-See: <http://usejsdoc.org/tags-typedef.html>
+See: <https://jsdoc.app/tags-typedef.html>
### Importing types
*/
```
-Prefer `alias` over `name`. See: <http://usejsdoc.org/tags-alias.html>
+Prefer `alias` over `name`. See: <https://jsdoc.app/tags-alias.html>
category: Markup
layout: 2017/sheet
prism_languages: [markdown]
-updated: 2020-06-24
+updated: 2020-07-01
weight: -1
---
# h1
## h2
### h3
+#### h4
+##### h5
+###### h6
```
```markdown
- [x] Checkbox on
```
+```markdown
+1. Item 1
+2. Item 2
+```
+
### Links
```markdown
it is nice
```
+### Advanced whitespaces
+
+```jade
+div
+ ' This appends a whitespace
+div
+ | This hackily prepends a whitespace
+div
+ => 'This appends a whitespace'
+div
+ =< 'This prepends a whitespace'
+```
+
### Inline HTML
```jade
### Invocation
| Command | Description |
-| --- | --- |
+| ------------------- | -------------------------------------------- |
| `tig` | |
| --- | --- |
| `tig status` | Status |
| `tig test..master` | Show difference between two branches |
| `tig FILE` | Show history of file |
| `tig v0.0.3:README` | Show contents of file in a specific revision |
+| `tig -C /repo/path` | Run in dir `/repo/path` (like `git -C`) |
You can substitute `git log` → `tig`.
### Nesting predicates
```
-//section[//h1[@id='hi']]
+//section[.//h1[@id='hi']]
```
This returns `<section>` if it has an `<h1>` descendant with `id='hi'`.