mirror of
https://github.com/Fechin/reference.git
synced 2026-11-29 16:40:48 +03:00
Format markdown table
This commit is contained in:
1 parent
e08ba67e92
commit
637a418a6f
37 files changed
+2718
-2718
No files matched your search
@@ -21,7 +21,7 @@ Getting started {.cols-3}
|
||||
$ awk -F: '{print $1, $NF}' /etc/passwd
|
||||
```
|
||||
----
|
||||
|- | - | - |
|
||||
| - | - | - |
|
||||
|---|---------------|---------------------------|
|
||||
| | `-F:` | Colon as a separator |
|
||||
| | `{...}` | Awk program |
|
||||
@@ -280,10 +280,10 @@ Awk Operators {.cols-3}
|
||||
| `$1 ~ /regex/` | Field matches |
|
||||
| `$1 !~ /regex/` | Field not matches |
|
||||
#### More conditions
|
||||
| - | - |
|
||||
|--------------------------|-----|
|
||||
| - | - |
|
||||
|------------------------|-----|
|
||||
| `($2 <= 4 || $3 < 20)` | Or |
|
||||
| `($1 == 4 && $3 < 20)` | And |
|
||||
| `($1 == 4 && $3 < 20)` | And |
|
||||
|
||||
### Operations
|
||||
#### Arithmetic operations
|
||||
@@ -745,14 +745,14 @@ Miscellaneous {.cols-3}
|
||||
{.cols-3 .style-none}
|
||||
|
||||
### Escape Sequences
|
||||
| - | - |
|
||||
|--------|---------------------|
|
||||
| `\b` | Backspace |
|
||||
| `\f` | Form feed |
|
||||
| `\n` | Newline (line feed) |
|
||||
| `\r` | Carriage return |
|
||||
| `\t` | Horizontal tab |
|
||||
| `\v` | Vertical tab |
|
||||
| - | - |
|
||||
|------|---------------------|
|
||||
| `\b` | Backspace |
|
||||
| `\f` | Form feed |
|
||||
| `\n` | Newline (line feed) |
|
||||
| `\r` | Carriage return |
|
||||
| `\t` | Horizontal tab |
|
||||
| `\v` | Vertical tab |
|
||||
|
||||
|
||||
### Run script
|
||||
|
||||
@@ -67,18 +67,18 @@ Multi-line comments use `:'` to open and `'` to close
|
||||
|
||||
### Arguments {.row-span-2}
|
||||
|
||||
| Expression | Description |
|
||||
| --- | --- |
|
||||
| `$1` … `$9`| Parameter 1 ... 9 |
|
||||
| `$0` | Name of the script itself |
|
||||
| `$1` | First argument |
|
||||
| `${10}` | Positional parameter 10 |
|
||||
| `$#` | Number of arguments |
|
||||
| `$$` | Process id of the shell |
|
||||
| `$*` | All arguments |
|
||||
| `$@` | All arguments, starting from first |
|
||||
| `$-` | Current options |
|
||||
| `$_` | Last argument of the previous command |
|
||||
| Expression | Description |
|
||||
|-------------|---------------------------------------|
|
||||
| `$1` … `$9` | Parameter 1 ... 9 |
|
||||
| `$0` | Name of the script itself |
|
||||
| `$1` | First argument |
|
||||
| `${10}` | Positional parameter 10 |
|
||||
| `$#` | Number of arguments |
|
||||
| `$$` | Process id of the shell |
|
||||
| `$*` | All arguments |
|
||||
| `$@` | All arguments, starting from first |
|
||||
| `$-` | Current options |
|
||||
| `$_` | Last argument of the previous command |
|
||||
|
||||
See: [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables).
|
||||
|
||||
@@ -116,7 +116,7 @@ echo {A,B}.js
|
||||
---
|
||||
|
||||
| Expression | Description |
|
||||
| ---------- | ------------------- |
|
||||
|------------|---------------------|
|
||||
| `{A,B}` | Same as `A B` |
|
||||
| `{A,B}.js` | Same as `A.js B.js` |
|
||||
| `{1..5}` | Same as `1 2 3 4 5` |
|
||||
@@ -143,7 +143,7 @@ Bash Parameter expansions {.cols-3}
|
||||
### Syntax {.row-span-2}
|
||||
|
||||
| Code | Description |
|
||||
| ----------------- | ------------------- |
|
||||
|-------------------|---------------------|
|
||||
| `${FOO%suffix}` | Remove suffix |
|
||||
| `${FOO#prefix}` | Remove prefix |
|
||||
| `${FOO%%suffix}` | Remove long suffix |
|
||||
@@ -154,20 +154,20 @@ Bash Parameter expansions {.cols-3}
|
||||
| `${FOO/#from/to}` | Replace prefix |
|
||||
#### Substrings
|
||||
| Expression | Description |
|
||||
| --------------- | ------------------------------ |
|
||||
|-----------------|--------------------------------|
|
||||
| `${FOO:0:3}` | Substring _(position, length)_ |
|
||||
| `${FOO:(-3):3}` | Substring from the right |
|
||||
#### Length
|
||||
| Expression | Description |
|
||||
| ---------- | ---------------- |
|
||||
|------------|------------------|
|
||||
| `${#FOO}` | Length of `$FOO` |
|
||||
#### Default values
|
||||
| Expression | Description |
|
||||
| ----------------- | -------------------------------------------------------- |
|
||||
| `${FOO:-val}` | `$FOO`, or `val` if unset |
|
||||
| `${FOO:=val}` | Set `$FOO` to `val` if unset |
|
||||
| `${FOO:+val}` | `val` if `$FOO` is set |
|
||||
| `${FOO:?message}` | Show message and exit if `$FOO` is unset |
|
||||
| Expression | Description |
|
||||
|-------------------|------------------------------------------|
|
||||
| `${FOO:-val}` | `$FOO`, or `val` if unset |
|
||||
| `${FOO:=val}` | Set `$FOO` to `val` if unset |
|
||||
| `${FOO:+val}` | `val` if `$FOO` is set |
|
||||
| `${FOO:?message}` | Show message and exit if `$FOO` is unset |
|
||||
|
||||
|
||||
|
||||
@@ -274,17 +274,17 @@ declare -a Numbers=(1 2 3 4 5 6)
|
||||
|
||||
### Indexing
|
||||
|
||||
| - | - |
|
||||
|--------------------|-----------------------|
|
||||
| `${Fruits[0]}` | First element |
|
||||
| `${Fruits[-1]}` | Last element |
|
||||
| `${Fruits[*]}` | All elements |
|
||||
| `${Fruits[@]}` | All elements |
|
||||
| `${#Fruits[@]}` | Number of all |
|
||||
| `${#Fruits}` | Length of 1st |
|
||||
| `${#Fruits[3]}` | Length of nth |
|
||||
| `${Fruits[@]:3:2}` | Range |
|
||||
| `${!Fruits[@]}` | Keys of all |
|
||||
| - | - |
|
||||
|--------------------|---------------|
|
||||
| `${Fruits[0]}` | First element |
|
||||
| `${Fruits[-1]}` | Last element |
|
||||
| `${Fruits[*]}` | All elements |
|
||||
| `${Fruits[@]}` | All elements |
|
||||
| `${#Fruits[@]}` | Number of all |
|
||||
| `${#Fruits}` | Length of 1st |
|
||||
| `${#Fruits[3]}` | Length of nth |
|
||||
| `${Fruits[@]:3:2}` | Range |
|
||||
| `${!Fruits[@]}` | Keys of all |
|
||||
|
||||
|
||||
|
||||
@@ -384,32 +384,32 @@ Bash Conditionals {.cols-3}
|
||||
|
||||
### Integer conditions
|
||||
|
||||
| Condition | Description |
|
||||
| --- | --- |
|
||||
| `[[ NUM -eq NUM ]]` | <yel>Eq</yel>ual |
|
||||
| `[[ NUM -ne NUM ]]` | <yel>N</yel>ot <yel>e</yel>qual |
|
||||
| `[[ NUM -lt NUM ]]` | <yel>L</yel>ess <yel>t</yel>han |
|
||||
| `[[ NUM -le NUM ]]` | <yel>L</yel>ess than or <yel>e</yel>qual |
|
||||
| `[[ NUM -gt NUM ]]` | <yel>G</yel>reater <yel>t</yel>han |
|
||||
| `[[ NUM -ge NUM ]]` | <yel>G</yel>reater than or <yel>e</yel>qual |
|
||||
| `(( NUM < NUM ))` | Less than |
|
||||
| `(( NUM <= NUM ))` | Less than or equal |
|
||||
| `(( NUM > NUM ))` | Greater than |
|
||||
| `(( NUM >= NUM ))` | Greater than or equal |
|
||||
| Condition | Description |
|
||||
|---------------------|---------------------------------------------|
|
||||
| `[[ NUM -eq NUM ]]` | <yel>Eq</yel>ual |
|
||||
| `[[ NUM -ne NUM ]]` | <yel>N</yel>ot <yel>e</yel>qual |
|
||||
| `[[ NUM -lt NUM ]]` | <yel>L</yel>ess <yel>t</yel>han |
|
||||
| `[[ NUM -le NUM ]]` | <yel>L</yel>ess than or <yel>e</yel>qual |
|
||||
| `[[ NUM -gt NUM ]]` | <yel>G</yel>reater <yel>t</yel>han |
|
||||
| `[[ NUM -ge NUM ]]` | <yel>G</yel>reater than or <yel>e</yel>qual |
|
||||
| `(( NUM < NUM ))` | Less than |
|
||||
| `(( NUM <= NUM ))` | Less than or equal |
|
||||
| `(( NUM > NUM ))` | Greater than |
|
||||
| `(( NUM >= NUM ))` | Greater than or equal |
|
||||
|
||||
|
||||
### String conditions
|
||||
|
||||
| Condition | Description |
|
||||
| --- | --- |
|
||||
| `[[ -z STR ]]` | Empty string |
|
||||
| `[[ -n STR ]]` | <yel>N</yel>ot empty string |
|
||||
| `[[ STR == STR ]]` | Equal |
|
||||
| `[[ STR = STR ]]` | Equal (Same above) |
|
||||
| `[[ STR < STR ]]` | Less than _(ASCII)_ |
|
||||
| `[[ STR > STR ]]` | Greater than _(ASCII)_ |
|
||||
| `[[ STR != STR ]]` | Not Equal |
|
||||
| `[[ STR =~ STR ]]` | Regexp |
|
||||
| Condition | Description |
|
||||
|--------------------|-----------------------------|
|
||||
| `[[ -z STR ]]` | Empty string |
|
||||
| `[[ -n STR ]]` | <yel>N</yel>ot empty string |
|
||||
| `[[ STR == STR ]]` | Equal |
|
||||
| `[[ STR = STR ]]` | Equal (Same above) |
|
||||
| `[[ STR < STR ]]` | Less than _(ASCII)_ |
|
||||
| `[[ STR > STR ]]` | Greater than _(ASCII)_ |
|
||||
| `[[ STR != STR ]]` | Not Equal |
|
||||
| `[[ STR =~ STR ]]` | Regexp |
|
||||
|
||||
|
||||
|
||||
@@ -470,29 +470,29 @@ fi
|
||||
|
||||
### File conditions {.row-span-2}
|
||||
|
||||
| Condition | Description |
|
||||
| --- | --- |
|
||||
| `[[ -e FILE ]]` | <yel>E</yel>xists |
|
||||
| `[[ -d FILE ]]` | <yel>D</yel>irectory |
|
||||
| `[[ -f FILE ]]` | <yel>F</yel>ile |
|
||||
| `[[ -h FILE ]]` | Symlink |
|
||||
| `[[ -s FILE ]]` | Size is > 0 bytes |
|
||||
| `[[ -r FILE ]]` | <yel>R</yel>eadable |
|
||||
| `[[ -w FILE ]]` | <yel>W</yel>ritable |
|
||||
| `[[ -x FILE ]]` | Executable |
|
||||
| `[[ f1 -nt f2 ]]` | f1 <yel>n</yel>ewer <yel>t</yel>han f2 |
|
||||
| `[[ f1 -ot f2 ]]` | f2 <yel>o</yel>lder <yel>t</yel>han f1 |
|
||||
| `[[ f1 -ef f2 ]]` | Same files |
|
||||
| Condition | Description |
|
||||
|-------------------|----------------------------------------|
|
||||
| `[[ -e FILE ]]` | <yel>E</yel>xists |
|
||||
| `[[ -d FILE ]]` | <yel>D</yel>irectory |
|
||||
| `[[ -f FILE ]]` | <yel>F</yel>ile |
|
||||
| `[[ -h FILE ]]` | Symlink |
|
||||
| `[[ -s FILE ]]` | Size is > 0 bytes |
|
||||
| `[[ -r FILE ]]` | <yel>R</yel>eadable |
|
||||
| `[[ -w FILE ]]` | <yel>W</yel>ritable |
|
||||
| `[[ -x FILE ]]` | Executable |
|
||||
| `[[ f1 -nt f2 ]]` | f1 <yel>n</yel>ewer <yel>t</yel>han f2 |
|
||||
| `[[ f1 -ot f2 ]]` | f2 <yel>o</yel>lder <yel>t</yel>han f1 |
|
||||
| `[[ f1 -ef f2 ]]` | Same files |
|
||||
|
||||
|
||||
### More conditions
|
||||
|
||||
| Condition | Description |
|
||||
| -------------------- | ------------------------ |
|
||||
| Condition | Description |
|
||||
|----------------------|----------------------|
|
||||
| `[[ -o noclobber ]]` | If OPTION is enabled |
|
||||
| `[[ ! EXPR ]]` | Not |
|
||||
| `[[ X && Y ]]` | And |
|
||||
| `[[ X || Y ]]` | Or |
|
||||
| `[[ ! EXPR ]]` | Not |
|
||||
| `[[ X && Y ]]` | And |
|
||||
| `[[ X || Y ]]` | Or |
|
||||
|
||||
|
||||
### logical and, or
|
||||
@@ -733,14 +733,14 @@ Bash History {.cols-2}
|
||||
### Commands
|
||||
|
||||
| Command | Description |
|
||||
| --------------------- | ----------------------------------------- |
|
||||
|-----------------------|-------------------------------------------|
|
||||
| `history` | Show history |
|
||||
| `shopt -s histverify` | Don't execute expanded result immediately |
|
||||
|
||||
### Expansions
|
||||
|
||||
| Expression | Description |
|
||||
| ------------ | ---------------------------------------------------- |
|
||||
|--------------|------------------------------------------------------|
|
||||
| `!$` | Expand last parameter of most recent command |
|
||||
| `!*` | Expand all parameters of most recent command |
|
||||
| `!-n` | Expand `n`th most recent command |
|
||||
@@ -750,7 +750,7 @@ Bash History {.cols-2}
|
||||
### Operations
|
||||
|
||||
| Code | Description |
|
||||
| -------------------- | --------------------------------------------------------------------- |
|
||||
|----------------------|-----------------------------------------------------------------------|
|
||||
| `!!` | Execute last command again |
|
||||
| `!!:s/<FROM>/<TO>/` | Replace first occurrence of `<FROM>` to `<TO>` in most recent command |
|
||||
| `!!:gs/<FROM>/<TO>/` | Replace all occurrences of `<FROM>` to `<TO>` in most recent command |
|
||||
@@ -762,7 +762,7 @@ Bash History {.cols-2}
|
||||
### Slices
|
||||
|
||||
| Code | Description |
|
||||
| -------- | ---------------------------------------------------------------------------------------- |
|
||||
|----------|------------------------------------------------------------------------------------------|
|
||||
| `!!:n` | Expand only `n`th token from most recent command (command is `0`; first argument is `1`) |
|
||||
| `!^` | Expand first argument from most recent command |
|
||||
| `!$` | Expand last token from most recent command |
|
||||
@@ -905,7 +905,7 @@ fi
|
||||
### Special variables {.row-span-2}
|
||||
|
||||
| Expression | Description |
|
||||
| ---------- | ---------------------------- |
|
||||
|------------|------------------------------|
|
||||
| `$?` | Exit status of last task |
|
||||
| `$!` | PID of last background task |
|
||||
| `$$` | PID of shell |
|
||||
|
||||
@@ -43,15 +43,15 @@ Chmod Generator allows you to quickly and visually generate permissions in numer
|
||||
### Common Permissions
|
||||
| Command | s | Meaning |
|
||||
|---------|-----------|------------------------------|
|
||||
|`400` | r-------- | Readable by owner only |
|
||||
|`500` | r-x------ | Avoid Changing |
|
||||
|`600` | rw------- | Changeable by user |
|
||||
|`644` | rw-r--r-- | Read and change by user |
|
||||
|`660` | rw-rw---- | Changeable by user and group |
|
||||
|`700` | rwx------ | Only user has full access |
|
||||
|`755` | rwxr-xr-x | Only changeable by user |
|
||||
|`775` | rwxrwxr-x | Sharing mode for a group |
|
||||
|`777` | rwxrwxrwx | Everybody can do everything |
|
||||
| `400` | r-------- | Readable by owner only |
|
||||
| `500` | r-x------ | Avoid Changing |
|
||||
| `600` | rw------- | Changeable by user |
|
||||
| `644` | rw-r--r-- | Read and change by user |
|
||||
| `660` | rw-rw---- | Changeable by user and group |
|
||||
| `700` | rwx------ | Only user has full access |
|
||||
| `755` | rwxr-xr-x | Only changeable by user |
|
||||
| `775` | rwxrwxr-x | Sharing mode for a group |
|
||||
| `777` | rwxrwxrwx | Everybody can do everything |
|
||||
|
||||
|
||||
### Explains
|
||||
@@ -89,11 +89,11 @@ d rwx r-x r-x
|
||||
|
||||
### Objects
|
||||
| Who (abbr.) | Meaning |
|
||||
|--------------|--------------------|
|
||||
| `u` | `U`ser |
|
||||
| `g` | `G`roup |
|
||||
| `o` | `O`thers |
|
||||
| `a` | `A`ll, same as ugo |
|
||||
|-------------|--------------------|
|
||||
| `u` | `U`ser |
|
||||
| `g` | `G`roup |
|
||||
| `o` | `O`thers |
|
||||
| `a` | `A`ll, same as ugo |
|
||||
{.show-header}
|
||||
|
||||
|
||||
|
||||
@@ -55,15 +55,15 @@ std::cout << age; // Print 25
|
||||
|
||||
|
||||
### Primitive Data Types
|
||||
| Data Type | Size | Range |
|
||||
|-----------|---------|---------------------|
|
||||
| `int` | 4 bytes | -2^31^ ^to^ 2^31^-1 |
|
||||
| `float` | 4 bytes |_N/A_ |
|
||||
| `double` | 8 bytes |_N/A_ |
|
||||
| `char` | 1 byte | -128 ^to^ 127 |
|
||||
| `bool` | 1 byte | true / false |
|
||||
| `void` |_N/A_ |_N/A_ |
|
||||
| `wchar_t` | 2 ^or^ 4 bytes| 1 wide character |
|
||||
| Data Type | Size | Range |
|
||||
|-----------|----------------|---------------------|
|
||||
| `int` | 4 bytes | -2^31^ ^to^ 2^31^-1 |
|
||||
| `float` | 4 bytes | _N/A_ |
|
||||
| `double` | 8 bytes | _N/A_ |
|
||||
| `char` | 1 byte | -128 ^to^ 127 |
|
||||
| `bool` | 1 byte | true / false |
|
||||
| `void` | _N/A_ | _N/A_ |
|
||||
| `wchar_t` | 2 ^or^ 4 bytes | 1 wide character |
|
||||
{.show-header}
|
||||
|
||||
|
||||
@@ -326,8 +326,8 @@ else
|
||||
|
||||
#### Assignment Operators
|
||||
|
||||
| Example | Equivalent to |
|
||||
|----------|-------------------------|
|
||||
| Example | Equivalent to |
|
||||
|----------|-----------------|
|
||||
| `a += b` | _Aka_ a = a + b |
|
||||
| `a -= b` | _Aka_ a = a - b |
|
||||
| `a *= b` | _Aka_ a = a * b |
|
||||
@@ -336,22 +336,22 @@ else
|
||||
|
||||
#### Logical Operators
|
||||
|
||||
| Example | Meaning |
|
||||
|----------------------|------------------------|
|
||||
| `exp1 && exp2` | Both are true _(AND)_ |
|
||||
| `exp1 || exp2` | Either is true _(OR)_ |
|
||||
| `!exp` | `exp` is false _(NOT)_ |
|
||||
| Example | Meaning |
|
||||
|----------------|------------------------|
|
||||
| `exp1 && exp2` | Both are true _(AND)_ |
|
||||
| `exp1 || exp2` | Either is true _(OR)_ |
|
||||
| `!exp` | `exp` is false _(NOT)_ |
|
||||
|
||||
#### Bitwise Operators
|
||||
|
||||
| Operator | Description |
|
||||
|--------------|-------------------------|
|
||||
| `a & b` | Binary AND |
|
||||
| `a | b` | Binary OR |
|
||||
| `a ^ b` | Binary XOR |
|
||||
| `a ~ b` | Binary One's Complement |
|
||||
| `a << b` | Binary Shift Left |
|
||||
| `a >> b` | Binary Shift Right |
|
||||
| Operator | Description |
|
||||
|----------|-------------------------|
|
||||
| `a & b` | Binary AND |
|
||||
| `a | b` | Binary OR |
|
||||
| `a ^ b` | Binary XOR |
|
||||
| `a ~ b` | Binary One's Complement |
|
||||
| `a << b` | Binary Shift Left |
|
||||
| `a >> b` | Binary Shift Right |
|
||||
|
||||
|
||||
### Ternary Operator
|
||||
@@ -693,17 +693,17 @@ Miscellaneous {.cols-3}
|
||||
|
||||
| Escape Sequences | Characters |
|
||||
|------------------|-----------------------|
|
||||
| `\b` | Backspace |
|
||||
| `\f` | Form feed |
|
||||
| `\n` | Newline |
|
||||
| `\r` | Return |
|
||||
| `\t` | Horizontal tab |
|
||||
| `\v` | Vertical tab |
|
||||
| `\\` | Backslash |
|
||||
| `\'` | Single quotation mark |
|
||||
| `\"` | Double quotation mark |
|
||||
| `\?` | Question mark |
|
||||
| `\0` | Null Character |
|
||||
| `\b` | Backspace |
|
||||
| `\f` | Form feed |
|
||||
| `\n` | Newline |
|
||||
| `\r` | Return |
|
||||
| `\t` | Horizontal tab |
|
||||
| `\v` | Vertical tab |
|
||||
| `\\` | Backslash |
|
||||
| `\'` | Single quotation mark |
|
||||
| `\"` | Double quotation mark |
|
||||
| `\?` | Question mark |
|
||||
| `\0` | Null Character |
|
||||
|
||||
|
||||
### Keywords {.col-span-2 .row-span-2}
|
||||
|
||||
@@ -53,13 +53,13 @@ Min Hour Day Mon Weekday
|
||||
|
||||
### Examples
|
||||
|
||||
| Example | Description |
|
||||
|----------------|------------------------------------------------------|
|
||||
| `*/15 * * * *` | Every 15 mins |
|
||||
| `0 * * * *` | Every hour |
|
||||
| `0 */2 * * *` | Every 2 hours |
|
||||
| `15 2 * * *` | At 2:15AM of every day |
|
||||
| `15 2 * * ?` | At 2:15AM of every day |
|
||||
| Example | Description |
|
||||
|----------------|------------------------|
|
||||
| `*/15 * * * *` | Every 15 mins |
|
||||
| `0 * * * *` | Every hour |
|
||||
| `0 */2 * * *` | Every 2 hours |
|
||||
| `15 2 * * *` | At 2:15AM of every day |
|
||||
| `15 2 * * ?` | At 2:15AM of every day |
|
||||
|
||||
| `10 9 * * 5` | At 9:10AM of every Friday |
|
||||
| `0 0 * * 0` | At midnight of every Sunday |
|
||||
@@ -89,17 +89,17 @@ Min Hour Day Mon Weekday
|
||||
### Crontab command
|
||||
|
||||
|
||||
| - | - |
|
||||
|------|-------------------------------------------------------------------------|
|
||||
| `crontab -e` | Edit or create a crontab file if doesn’t already exist. |
|
||||
| `crontab -l` | Display the crontab file. |
|
||||
| `crontab -r` | Remove the crontab file. |
|
||||
| - | - |
|
||||
|--------------|-------------------------------------------------------------------------|
|
||||
| `crontab -e` | Edit or create a crontab file if doesn’t already exist. |
|
||||
| `crontab -l` | Display the crontab file. |
|
||||
| `crontab -r` | Remove the crontab file. |
|
||||
| `crontab -v` | Display the last time you edited your crontab file.<br>_(non-standard)_ |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
### Special characters {.col-span-2}
|
||||
| Special Character | Description |
|
||||
| Special Character | Description |
|
||||
|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `Asterik(*)` | Matches all values in the field or any possible value. |
|
||||
| `Hyphen(-)` | Used to define a range.Ex: 1-5 in 5th field(Day Of Week) Every Weekday i.e., Monday to Friday |
|
||||
|
||||
@@ -248,43 +248,43 @@ p:first-child {
|
||||
|
||||
### Basic
|
||||
|
||||
| | |
|
||||
|---------------------------|-----------------------------------|
|
||||
| `*` | All elements |
|
||||
| `div` | All div tags |
|
||||
| `.classname` | All elements with class |
|
||||
| `#idname` | Element with ID |
|
||||
| `div,p` | All divs and paragraphs |
|
||||
| `#idname *` | All elements inside #idname |
|
||||
| | |
|
||||
|--------------|-----------------------------|
|
||||
| `*` | All elements |
|
||||
| `div` | All div tags |
|
||||
| `.classname` | All elements with class |
|
||||
| `#idname` | Element with ID |
|
||||
| `div,p` | All divs and paragraphs |
|
||||
| `#idname *` | All elements inside #idname |
|
||||
See also: [Type](https://developer.mozilla.org/en-US/docs/Web/CSS/Type_selectors) / [Class](https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors) / [ID](https://developer.mozilla.org/en-US/docs/Web/CSS/ID_selectors) / [Universal](https://developer.mozilla.org/en-US/docs/Web/CSS/Universal_selectors) selectors
|
||||
|
||||
|
||||
### Combinators
|
||||
|
||||
| Selector | Description |
|
||||
| ------------------- | ----------------- |
|
||||
| `div.classname` | Div with certain classname |
|
||||
| `div#idname` | Div with certain ID |
|
||||
| `div p` | Paragraphs inside divs |
|
||||
| `div > p` | All p tags<br>_one level deep in div_ |
|
||||
| `div + p` | P tags immediately after div |
|
||||
| `div ~ p` | P tags preceded by div |
|
||||
| Selector | Description |
|
||||
|-----------------|---------------------------------------|
|
||||
| `div.classname` | Div with certain classname |
|
||||
| `div#idname` | Div with certain ID |
|
||||
| `div p` | Paragraphs inside divs |
|
||||
| `div > p` | All p tags<br>_one level deep in div_ |
|
||||
| `div + p` | P tags immediately after div |
|
||||
| `div ~ p` | P tags preceded by div |
|
||||
See also: [Adjacent](https://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_combinator) / [Sibling](https://developer.mozilla.org/en-US/docs/Web/CSS/General_sibling_combinator) / [Child](https://developer.mozilla.org/en-US/docs/Web/CSS/Child_combinator) selectors
|
||||
|
||||
|
||||
|
||||
### Attribute selectors
|
||||
|
||||
| | |
|
||||
|---------------------------|-----------------------------------|
|
||||
| `a[target]` | With a <yel>target</yel> attribute |
|
||||
| `a[target="_blank"]` | Open in new tab |
|
||||
| `a[href^="/index"]` | Starts with <yel>/index</yel> |
|
||||
| `[class|="chair"]` | Starts with <yel>chair</yel> |
|
||||
| `[class*="chair"]` | containing <yel>chair</yel> |
|
||||
| `[title~="chair"]` | Contains the word <yel>chair</yel> |
|
||||
| `a[href$=".doc"]` | Ends with <yel>.doc</yel> |
|
||||
| `[type="button"]` | Specified type |
|
||||
| | |
|
||||
|----------------------|------------------------------------|
|
||||
| `a[target]` | With a <yel>target</yel> attribute |
|
||||
| `a[target="_blank"]` | Open in new tab |
|
||||
| `a[href^="/index"]` | Starts with <yel>/index</yel> |
|
||||
| `[class|="chair"]` | Starts with <yel>chair</yel> |
|
||||
| `[class*="chair"]` | containing <yel>chair</yel> |
|
||||
| `[title~="chair"]` | Contains the word <yel>chair</yel> |
|
||||
| `a[href$=".doc"]` | Ends with <yel>.doc</yel> |
|
||||
| `[type="button"]` | Specified type |
|
||||
|
||||
See also: [Attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors)
|
||||
|
||||
@@ -292,65 +292,65 @@ See also: [Attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS
|
||||
|
||||
|
||||
### User action pseudo classes
|
||||
| | |
|
||||
|---------------------------|-----------------------------------|
|
||||
| `a:link ` | Link in normal state |
|
||||
| `a:active ` | Link in clicked state |
|
||||
| `a:hover ` | Link with mouse over it |
|
||||
| `a:visited ` | Visited link |
|
||||
| | |
|
||||
|--------------|-------------------------|
|
||||
| `a:link ` | Link in normal state |
|
||||
| `a:active ` | Link in clicked state |
|
||||
| `a:hover ` | Link with mouse over it |
|
||||
| `a:visited ` | Visited link |
|
||||
|
||||
|
||||
|
||||
### Pseudo classes
|
||||
| | |
|
||||
|---------------------------|-----------------------------------|
|
||||
| `p::after` | Add content after p |
|
||||
| `p::before` | Add content before p |
|
||||
| `p::first-letter` | First letter in p |
|
||||
| `p::first-line` | First line in p |
|
||||
| `::selection` | Selected by user |
|
||||
| `::placeholder` | [Placeholder](https://developer.mozilla.org/en-US/docs/Web/CSS/::placeholder) attribute |
|
||||
| `:root` | Documents root element |
|
||||
| `:target` | Highlight active anchor |
|
||||
| `div:empty` | Element with no children |
|
||||
| `p:lang(en)` | P with en language attribute |
|
||||
| `:not(span)` | Element that's not a span |
|
||||
| | |
|
||||
|-------------------|-----------------------------------------------------------------------------------------|
|
||||
| `p::after` | Add content after p |
|
||||
| `p::before` | Add content before p |
|
||||
| `p::first-letter` | First letter in p |
|
||||
| `p::first-line` | First line in p |
|
||||
| `::selection` | Selected by user |
|
||||
| `::placeholder` | [Placeholder](https://developer.mozilla.org/en-US/docs/Web/CSS/::placeholder) attribute |
|
||||
| `:root` | Documents root element |
|
||||
| `:target` | Highlight active anchor |
|
||||
| `div:empty` | Element with no children |
|
||||
| `p:lang(en)` | P with en language attribute |
|
||||
| `:not(span)` | Element that's not a span |
|
||||
|
||||
|
||||
|
||||
### Input pseudo classes
|
||||
| | |
|
||||
|---------------------------|-----------------------------------|
|
||||
| `input:checked` | Checked inputs |
|
||||
| `input:disabled` | Disabled inputs |
|
||||
| `input:enabled` | Enabled inputs |
|
||||
| `input:focus` | Input has focus |
|
||||
| `input:in-range` | Value in range |
|
||||
| `input:out-of-range` | Input value out of range |
|
||||
| `input:valid` | Input with valid value |
|
||||
| `input:invalid` | Input with invalid value |
|
||||
| `input:optional` | No required attribute |
|
||||
| `input:required` | Input with required attribute |
|
||||
| `input:read-only` | With readonly attribute |
|
||||
| `input:read-write` | No readonly attribute |
|
||||
| `input:indeterminate` | With [indeterminate](https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate) state |
|
||||
| | |
|
||||
|-----------------------|---------------------------------------------------------------------------------------------|
|
||||
| `input:checked` | Checked inputs |
|
||||
| `input:disabled` | Disabled inputs |
|
||||
| `input:enabled` | Enabled inputs |
|
||||
| `input:focus` | Input has focus |
|
||||
| `input:in-range` | Value in range |
|
||||
| `input:out-of-range` | Input value out of range |
|
||||
| `input:valid` | Input with valid value |
|
||||
| `input:invalid` | Input with invalid value |
|
||||
| `input:optional` | No required attribute |
|
||||
| `input:required` | Input with required attribute |
|
||||
| `input:read-only` | With readonly attribute |
|
||||
| `input:read-write` | No readonly attribute |
|
||||
| `input:indeterminate` | With [indeterminate](https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate) state |
|
||||
|
||||
|
||||
|
||||
### Structural pseudo classes
|
||||
| | |
|
||||
|---------------------------|-----------------------------------|
|
||||
| `p:first-child` | First child |
|
||||
| `p:last-child` | Last child |
|
||||
| `p:first-of-type` | First of some type |
|
||||
| `p:last-of-type` | Last of some type |
|
||||
| `p:nth-child(2)` | Second child of its parent |
|
||||
| `p:nth-child(3n42)` | Nth-child (an + b) formula |
|
||||
| `p:nth-last-child(2)` | Second child from behind |
|
||||
| `p:nth-of-type(2)` | Second p of its parent |
|
||||
| `p:nth-last-of-type(2)` | ...from behind |
|
||||
| `p:only-of-type` | Unique of its parent |
|
||||
| `p:only-child` | Only child of its parent |
|
||||
| | |
|
||||
|-------------------------|----------------------------|
|
||||
| `p:first-child` | First child |
|
||||
| `p:last-child` | Last child |
|
||||
| `p:first-of-type` | First of some type |
|
||||
| `p:last-of-type` | Last of some type |
|
||||
| `p:nth-child(2)` | Second child of its parent |
|
||||
| `p:nth-child(3n42)` | Nth-child (an + b) formula |
|
||||
| `p:nth-last-child(2)` | Second child from behind |
|
||||
| `p:nth-of-type(2)` | Second p of its parent |
|
||||
| `p:nth-last-of-type(2)` | ...from behind |
|
||||
| `p:only-of-type` | Unique of its parent |
|
||||
| `p:only-child` | Only child of its parent |
|
||||
|
||||
|
||||
|
||||
@@ -360,12 +360,12 @@ CSS Fonts {.cols-3}
|
||||
|
||||
### Properties {.row-span-3}
|
||||
|
||||
| Property | Description |
|
||||
| ------------------ | ------------------------------------ |
|
||||
| `font-family:` | \<font> <fontN> |
|
||||
| `font-size:` | \<size> |
|
||||
| `letter-spacing:` | \<size> |
|
||||
| `line-height:` | \<number> |
|
||||
| Property | Description |
|
||||
|-------------------|-----------------|
|
||||
| `font-family:` | \<font> <fontN> |
|
||||
| `font-size:` | \<size> |
|
||||
| `letter-spacing:` | \<size> |
|
||||
| `line-height:` | \<number> |
|
||||
|
||||
| `font-weight:` | \<number> / bold / normal |
|
||||
| `font-style:` | italic / normal |
|
||||
@@ -380,7 +380,7 @@ See also: [Font](https://developer.mozilla.org/en-US/docs/Web/CSS/font)
|
||||
### Shorthand {.secondary .col-span-2}
|
||||
|
||||
| | style | weight | size (required) | | line-height | family |
|
||||
| ------- | -------- | ------ | --------------- | --- | ----------- | ----------------- |
|
||||
|---------|----------|--------|-----------------|-----|-------------|-------------------|
|
||||
| `font:` | `italic` | `400` | `14px` | `/` | `1.5` | `sans-serif` |
|
||||
| | style | weight | size (required) | | line-height | family (required) |
|
||||
|
||||
@@ -489,9 +489,9 @@ CSS Backgrounds {.cols-3}
|
||||
|
||||
### Properties {.row-span-2}
|
||||
|
||||
| Property | Description |
|
||||
| ------------------------ | ---------------------------------------- |
|
||||
| `background:` | _(Shorthand)_ |
|
||||
| Property | Description |
|
||||
|---------------|---------------|
|
||||
| `background:` | _(Shorthand)_ |
|
||||
|
||||
| `background-color:` | See: [Colors](#colors) |
|
||||
| `background-image:` | url(...) |
|
||||
@@ -504,11 +504,11 @@ CSS Backgrounds {.cols-3}
|
||||
|
||||
### Shorthand {.secondary .col-span-2}
|
||||
|
||||
| | color | image | positionX | positionY | | size | repeat | attachment |
|
||||
| ------------- | ------ | ------------- | --------- | --------- | --- | -------------- | ----------- | ---------- |
|
||||
| | color | image | positionX | positionY | | size | repeat | attachment |
|
||||
|---------------|--------|--------------|-----------|-----------|-----|----------------|-------------|------------|
|
||||
| `background:` | `#ff0` | `url(a.jpg)` | `left` | `top` | `/` | `100px` `auto` | `no-repeat` | `fixed;` |
|
||||
| `background:` | `#abc` | `url(b.png)` | `center` | `center` | `/` | `cover` | `repeat-x` | `local;` |
|
||||
| | color | image | posX | posY | | size | repeat | attach..|
|
||||
| | color | image | posX | posY | | size | repeat | attach.. |
|
||||
|
||||
### Examples {.col-span-2}
|
||||
|
||||
@@ -601,23 +601,23 @@ CSS Animation {.cols-5}
|
||||
### Shorthand {.col-span-5 .secondary}
|
||||
|
||||
| | name | duration | timing-function | delay | count | direction | fill-mode | play-state |
|
||||
| ------------ | -------- | -------- | --------------- | ------- | ---------- | ------------------- | --------- | ---------- |
|
||||
|--------------|----------|----------|-----------------|---------|------------|---------------------|-----------|------------|
|
||||
| `animation:` | `bounce` | `300ms` | `linear` | `100ms` | `infinite` | `alternate-reverse` | `both` | `reverse` |
|
||||
| | name | duration | timing-function | delay | count | direction | fill-mode | play-state |
|
||||
|
||||
### Properties {.row-span-2 .col-span-2}
|
||||
|
||||
| Property | Value |
|
||||
| ---------------------------- | -------------------------------------------------------- |
|
||||
| `animation:` | _(shorthand)_ |
|
||||
| Property | Value |
|
||||
|------------------------------|--------------------------------------------------------|
|
||||
| `animation:` | _(shorthand)_ |
|
||||
| `animation-name:` | \<name> |
|
||||
| `animation-duration:` | \<time>ms |
|
||||
| `animation-timing-function:` | ease / linear / ease-in / ease-out / ease-in-out |
|
||||
| `animation-timing-function:` | ease / linear / ease-in / ease-out / ease-in-out |
|
||||
| `animation-delay:` | \<time>ms |
|
||||
| `animation-iteration-count:` | infinite / \<number> |
|
||||
| `animation-direction:` | normal / reverse / alternate / alternate-reverse |
|
||||
| `animation-fill-mode:` | none / forwards / backwards / both / initial / inherit|
|
||||
| `animation-play-state:` | normal / reverse / alternate / alternate-reverse |
|
||||
| `animation-direction:` | normal / reverse / alternate / alternate-reverse |
|
||||
| `animation-fill-mode:` | none / forwards / backwards / both / initial / inherit |
|
||||
| `animation-play-state:` | normal / reverse / alternate / alternate-reverse |
|
||||
{.left-text}
|
||||
|
||||
See also: [Animation](https://developer.mozilla.org/en-US/docs/Web/CSS/animation)
|
||||
|
||||
@@ -71,7 +71,7 @@ Docker Containers {.cols-2}
|
||||
|
||||
|
||||
### Starting & Stopping
|
||||
| Description | Example |
|
||||
| Description | Example |
|
||||
|-------------------------------|-------------------------------------|
|
||||
| `docker start nginx-server` | Starting |
|
||||
| `docker stop nginx-server` | Stopping |
|
||||
@@ -86,10 +86,10 @@ Docker Containers {.cols-2}
|
||||
|
||||
### Information
|
||||
|
||||
| Example | Description |
|
||||
|---------------------------|----------------------------------------|
|
||||
| `docker ps` | List running containers |
|
||||
| `docker ps -a` | List all containers |
|
||||
| Example | Description |
|
||||
|-------------------------------|----------------------------------------|
|
||||
| `docker ps` | List running containers |
|
||||
| `docker ps -a` | List all containers |
|
||||
| `docker logs nginx-server` | Container Logs |
|
||||
| `docker inspect nginx-server` | Inspecting Containers |
|
||||
| `docker events nginx-server` | Containers Events |
|
||||
@@ -141,17 +141,17 @@ Docker Images {.cols-2}
|
||||
------
|
||||
|
||||
### Manipulating
|
||||
| `Example` | Description |
|
||||
|------------------------------------|------------------------------------------------------------|
|
||||
| `docker images` | Listing images |
|
||||
| `docker rmi nginx` | Removing an image |
|
||||
| `docker load < ubuntu.tar.gz` | Loading a tarred repository |
|
||||
| `docker load --input ubuntu.tar` | Loading a tarred repository |
|
||||
| `docker save busybox > ubuntu.tar` | Save an image to a tar archive |
|
||||
| `docker history` | Showing the history of an image |
|
||||
| `docker commit nginx` | Save a container as an image. |
|
||||
| `docker tag nginx eon01/nginx` | Tagging an image |
|
||||
| `docker push eon01/nginx` | Pushing an image |
|
||||
| `Example` | Description |
|
||||
|------------------------------------|---------------------------------|
|
||||
| `docker images` | Listing images |
|
||||
| `docker rmi nginx` | Removing an image |
|
||||
| `docker load < ubuntu.tar.gz` | Loading a tarred repository |
|
||||
| `docker load --input ubuntu.tar` | Loading a tarred repository |
|
||||
| `docker save busybox > ubuntu.tar` | Save an image to a tar archive |
|
||||
| `docker history` | Showing the history of an image |
|
||||
| `docker commit nginx` | Save a container as an image. |
|
||||
| `docker tag nginx eon01/nginx` | Tagging an image |
|
||||
| `docker push eon01/nginx` | Pushing an image |
|
||||
|
||||
|
||||
### Building Images
|
||||
@@ -229,12 +229,12 @@ Miscellaneous {.cols-2}
|
||||
|
||||
|
||||
### Docker Hub
|
||||
| Docker Syntax | Description |
|
||||
|----------------------------|-------------------------------------|
|
||||
| `docker search search_word`| Search docker hub for images. |
|
||||
| `docker pull user/image `| Downloads an image from docker hub. |
|
||||
| `docker login `| Authenticate to docker hub |
|
||||
| `docker push user/image `| Uploads an image to docker hub. |
|
||||
| Docker Syntax | Description |
|
||||
|-----------------------------|-------------------------------------|
|
||||
| `docker search search_word` | Search docker hub for images. |
|
||||
| `docker pull user/image ` | Downloads an image from docker hub. |
|
||||
| `docker login ` | Authenticate to docker hub |
|
||||
| `docker push user/image ` | Uploads an image to docker hub. |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,17 +26,17 @@ $ emacs
|
||||
|
||||
------
|
||||
|
||||
| - | - |
|
||||
|-------------|------------------------------------------|
|
||||
| `C-z` | Suspend Emacs |
|
||||
| `C-x` `C-c` | Exit Emacs permanently |
|
||||
| - | - |
|
||||
|-------------|------------------------|
|
||||
| `C-z` | Suspend Emacs |
|
||||
| `C-x` `C-c` | Exit Emacs permanently |
|
||||
{.shortcuts}
|
||||
|
||||
### Global Description {.secondary}
|
||||
| - | - |
|
||||
|-------------|------------------------------------------|
|
||||
| `C-<key>` | Means hold the control, and press `<key>` |
|
||||
| `M-<key>` | Means press the Esc once, and press `<key>` |
|
||||
| - | - |
|
||||
|-----------|---------------------------------------------|
|
||||
| `C-<key>` | Means hold the control, and press `<key>` |
|
||||
| `M-<key>` | Means press the Esc once, and press `<key>` |
|
||||
{.shortcuts}
|
||||
|
||||
NOTICE: This cheatsheet follows the above rules.
|
||||
@@ -44,29 +44,29 @@ NOTICE: This cheatsheet follows the above rules.
|
||||
|
||||
### Motion {.row-span-2}
|
||||
|
||||
| Backward | Forward | Entity to move over |
|
||||
|------------|-----------|----------------------------------|
|
||||
| `C-b` | `C-f` | Haracter |
|
||||
| `M-b` | `M-f` | Word |
|
||||
| `C-p` | `C-n` | Line |
|
||||
| `C-a` | `C-e` | Line beginning<br/>_(or end)_ |
|
||||
| `M-a` | `M-e` | Sentence |
|
||||
| `M-{` | `M-}` | Paragraph |
|
||||
| `C-x` `[` | `C-x` `]` | Page |
|
||||
| `C-M-b` | `C-M-f` | Sexp |
|
||||
| `C-M-a` | `C-M-e` | Function |
|
||||
| `M-<` | `M->` | Buffer beginning<br>_(or end)_|
|
||||
| Backward | Forward | Entity to move over |
|
||||
|-----------|-----------|--------------------------------|
|
||||
| `C-b` | `C-f` | Haracter |
|
||||
| `M-b` | `M-f` | Word |
|
||||
| `C-p` | `C-n` | Line |
|
||||
| `C-a` | `C-e` | Line beginning<br/>_(or end)_ |
|
||||
| `M-a` | `M-e` | Sentence |
|
||||
| `M-{` | `M-}` | Paragraph |
|
||||
| `C-x` `[` | `C-x` `]` | Page |
|
||||
| `C-M-b` | `C-M-f` | Sexp |
|
||||
| `C-M-a` | `C-M-e` | Function |
|
||||
| `M-<` | `M->` | Buffer beginning<br>_(or end)_ |
|
||||
{.shortcuts .show-header}
|
||||
|
||||
|
||||
|
||||
### Case Change
|
||||
|
||||
| - | - |
|
||||
|-----------|------------------|
|
||||
| `M-u` | Uppercase word |
|
||||
| `M-l` | Lowercase word |
|
||||
| `M-c` | Capitalize word |
|
||||
| - | - |
|
||||
|-------------|------------------|
|
||||
| `M-u` | Uppercase word |
|
||||
| `M-l` | Lowercase word |
|
||||
| `M-c` | Capitalize word |
|
||||
| `C-x` `C-u` | Uppercase region |
|
||||
| `C-x` `C-l` | Lowercase region |
|
||||
{.shortcuts}
|
||||
@@ -75,7 +75,7 @@ NOTICE: This cheatsheet follows the above rules.
|
||||
|
||||
### Files
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|-------------|--------------------------------------------------|
|
||||
| `C-x` `C-f` | Read a file into Emacs |
|
||||
| `C-x` `C-s` | Save a file back to disk |
|
||||
@@ -91,13 +91,13 @@ NOTICE: This cheatsheet follows the above rules.
|
||||
|
||||
### Error Recovery
|
||||
|
||||
| - | - |
|
||||
|-----------------------|--------------------------------------------|
|
||||
| `C-g` | Abort partially typed or executing command |
|
||||
| `M-x` recover-session | Recover files lost by a system crash |
|
||||
| `C-x` `u`<br>`C-_`<br>`C-/` | Undo an unwanted change |
|
||||
| `M-x` revert-buffer | Restore a buffer to its original contents |
|
||||
| `C-l` | Redraw garbaged screen |
|
||||
| - | - |
|
||||
|-----------------------------|--------------------------------------------|
|
||||
| `C-g` | Abort partially typed or executing command |
|
||||
| `M-x` recover-session | Recover files lost by a system crash |
|
||||
| `C-x` `u`<br>`C-_`<br>`C-/` | Undo an unwanted change |
|
||||
| `M-x` revert-buffer | Restore a buffer to its original contents |
|
||||
| `C-l` | Redraw garbaged screen |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
@@ -105,32 +105,32 @@ NOTICE: This cheatsheet follows the above rules.
|
||||
|
||||
### Transposing {.row-span-2}
|
||||
|
||||
| - | - |
|
||||
|-----------|----------------------|
|
||||
| `C-t` | Transpose characters |
|
||||
| `M-t` | Transpose words |
|
||||
| - | - |
|
||||
|-------------|----------------------|
|
||||
| `C-t` | Transpose characters |
|
||||
| `M-t` | Transpose words |
|
||||
| `C-x` `C-t` | Transpose lines |
|
||||
| `C-M-t` | Transpose sexps |
|
||||
| `C-M-t` | Transpose sexps |
|
||||
{.shortcuts}
|
||||
|
||||
#### Scroll
|
||||
|
||||
| - | - |
|
||||
|---------|--------------------------------------------------|
|
||||
| `C-v` | Scroll to next screen |
|
||||
| `M-v` | Scroll to previous screen |
|
||||
| - | - |
|
||||
|-----------|--------------------------------------------------|
|
||||
| `C-v` | Scroll to next screen |
|
||||
| `M-v` | Scroll to previous screen |
|
||||
| `C-x` `<` | Scroll left |
|
||||
| `C-x` `>` | Scroll right |
|
||||
| `C-l` | Scroll current line to <br>_center, top, bottom_ |
|
||||
| `C-l` | Scroll current line to <br>_center, top, bottom_ |
|
||||
{.shortcuts}
|
||||
|
||||
#### Goto
|
||||
|
||||
| - | - |
|
||||
|---------|----------------------|
|
||||
| `M-g` `g` | Goto line |
|
||||
| `M-g` `c` | Goto char |
|
||||
| `M-m` | Back to indentation |
|
||||
| - | - |
|
||||
|-----------|---------------------|
|
||||
| `M-g` `g` | Goto line |
|
||||
| `M-g` `c` | Goto char |
|
||||
| `M-m` | Back to indentation |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
@@ -139,16 +139,16 @@ NOTICE: This cheatsheet follows the above rules.
|
||||
|
||||
### Marking
|
||||
|
||||
| - | - |
|
||||
|----------------|-------------------------|
|
||||
| `C-@`<br/>`C-SPC`| Uet mark here |
|
||||
| `C-x` `C-x` | Exchange point and mark |
|
||||
| `M-@` | Set mark arg words away |
|
||||
| `M-h` | Mark paragraph |
|
||||
| `C-x` `C-p` | Mark page |
|
||||
| `C-M-@` | Mark sexp |
|
||||
| `C-M-h` | Mark function |
|
||||
| `C-x` `h` | Mark entire buffer |
|
||||
| - | - |
|
||||
|-------------------|-------------------------|
|
||||
| `C-@`<br/>`C-SPC` | Uet mark here |
|
||||
| `C-x` `C-x` | Exchange point and mark |
|
||||
| `M-@` | Set mark arg words away |
|
||||
| `M-h` | Mark paragraph |
|
||||
| `C-x` `C-p` | Mark page |
|
||||
| `C-M-@` | Mark sexp |
|
||||
| `C-M-h` | Mark function |
|
||||
| `C-x` `h` | Mark entire buffer |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
@@ -156,17 +156,17 @@ NOTICE: This cheatsheet follows the above rules.
|
||||
|
||||
### Killing and Deleting {.row-span-2}
|
||||
|
||||
| Backward | Forward | Entity to kill |
|
||||
|-------------|------------|--------------------------------------|
|
||||
| `DEL` | `C-d` | Character <br>_(delete)_ |
|
||||
| `M-DEL` | `M-d` | Word |
|
||||
| `M-0` `C-k` | `C-k` | Line <br/> _(to end of)_ |
|
||||
| `C-x` `DEL` | `M-k` | Sentence |
|
||||
| `M--` `C-M-k` | `C-M-k` | Sexp |
|
||||
| Backward | Forward | Entity to kill |
|
||||
|---------------|---------|--------------------------|
|
||||
| `DEL` | `C-d` | Character <br>_(delete)_ |
|
||||
| `M-DEL` | `M-d` | Word |
|
||||
| `M-0` `C-k` | `C-k` | Line <br/> _(to end of)_ |
|
||||
| `C-x` `DEL` | `M-k` | Sentence |
|
||||
| `M--` `C-M-k` | `C-M-k` | Sexp |
|
||||
{.shortcuts .show-header}
|
||||
#### Killing
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|------------|--------------------------------------|
|
||||
| `C-W` | Kill region C-w |
|
||||
| `M-w` | Copy region to kill ring |
|
||||
@@ -181,10 +181,10 @@ NOTICE: This cheatsheet follows the above rules.
|
||||
|
||||
### Getting Help
|
||||
|
||||
| - | - |
|
||||
|---------|------------------------------------------|
|
||||
| - | - |
|
||||
|-----------|------------------------------------------|
|
||||
| `C-x` `1` | Remove help window |
|
||||
| `C-M-v` | Scroll help window |
|
||||
| `C-M-v` | Scroll help window |
|
||||
| `C-h` `a` | Apropos: show commands matching a string |
|
||||
| `C-h` `k` | Describe the function a key runs |
|
||||
| `C-h` `f` | Describe a function |
|
||||
@@ -198,11 +198,11 @@ The help system is simple. Type `C-h` (or `F1`) and follow the directions. If yo
|
||||
|
||||
### Multiple Windows {.col-span-2}
|
||||
When two commands are shown, the second is a similar command for a frame instead of a window.
|
||||
| - | - | - |
|
||||
|-------------|-------------|-------------------------------------|
|
||||
| `C-x` `5` `1` | `C-x` `1` | Delete all other windows |
|
||||
| `C-x` `5` `2` | `C-x` `2` | Split window, above and below |
|
||||
| `C-x` `5` `0` | `C-x` `0` | Delete this window |
|
||||
| - | - | - |
|
||||
|---------------|-----------|-------------------------------|
|
||||
| `C-x` `5` `1` | `C-x` `1` | Delete all other windows |
|
||||
| `C-x` `5` `2` | `C-x` `2` | Split window, above and below |
|
||||
| `C-x` `5` `0` | `C-x` `0` | Delete this window |
|
||||
|
||||
| `C-x` `3` || Split window, side by side |
|
||||
| `C-M-v` || Scroll other window |
|
||||
@@ -225,23 +225,23 @@ When two commands are shown, the second is a similar command for a frame instead
|
||||
|
||||
### Formatting
|
||||
|
||||
| - | - |
|
||||
|-----------|------------------------------------------|
|
||||
| `TAB` | Indent current line (mode-dependent) |
|
||||
| `C-M-\` | Indent region (mode-dependent) |
|
||||
| `C-M-q` | Indent sexp (mode-dependent) |
|
||||
| - | - |
|
||||
|-------------|------------------------------------------|
|
||||
| `TAB` | Indent current line (mode-dependent) |
|
||||
| `C-M-\` | Indent region (mode-dependent) |
|
||||
| `C-M-q` | Indent sexp (mode-dependent) |
|
||||
| `C-x` `TAB` | Indent region rigidly arg columns |
|
||||
| `M-;` | Indent for comment |
|
||||
| `C-o` | Insert newline after point |
|
||||
| `C-M-o` | Move rest of line vertically down |
|
||||
| `M-;` | Indent for comment |
|
||||
| `C-o` | Insert newline after point |
|
||||
| `C-M-o` | Move rest of line vertically down |
|
||||
| `C-x` `C-o` | Delete blank lines around point |
|
||||
| `M-^` | Join line with previous (with arg, next) |
|
||||
| `M-\` | Delete all white space around point |
|
||||
| `M-SPC` | Put exactly one space at point |
|
||||
| `M-q` | Fill paragraph |
|
||||
| `M-^` | Join line with previous (with arg, next) |
|
||||
| `M-\` | Delete all white space around point |
|
||||
| `M-SPC` | Put exactly one space at point |
|
||||
| `M-q` | Fill paragraph |
|
||||
| `C-x` `f` | Set fill column to arg |
|
||||
| `C-x` `.` | Set prefix each line starts with |
|
||||
| `M-o` | Set face |
|
||||
| `M-o` | Set face |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
@@ -249,45 +249,45 @@ When two commands are shown, the second is a similar command for a frame instead
|
||||
|
||||
### Info {.row-span-2}
|
||||
|
||||
| - | - |
|
||||
|---------|---------------------------------------------|
|
||||
| - | - |
|
||||
|-----------|---------------------------------------------|
|
||||
| `C-h` `i` | Enter the Info documentation reader |
|
||||
| `C-h` `S` | Find specified function or variable in Info |
|
||||
{.shortcuts}
|
||||
|
||||
#### Moving within a node
|
||||
|
||||
| - | - |
|
||||
|---------|---------------------------------------------|
|
||||
| `SPC` | Scroll forward |
|
||||
| `DEL` | Scroll reverse |
|
||||
| `b` | Beginning of node |
|
||||
| - | - |
|
||||
|-------|-------------------|
|
||||
| `SPC` | Scroll forward |
|
||||
| `DEL` | Scroll reverse |
|
||||
| `b` | Beginning of node |
|
||||
{.shortcuts}
|
||||
|
||||
#### Moving between nodes
|
||||
|
||||
| - | - |
|
||||
|---------|---------------------------------------------|
|
||||
| `n` | Next node |
|
||||
| `p` | Previous node |
|
||||
| `u` | Move up |
|
||||
| `m` | Select menu item by name |
|
||||
| `n` | Select nth menu item by number (1–9) |
|
||||
| `f` | Follow cross reference (return with l) |
|
||||
| `l` | Return to last node you saw |
|
||||
| `d` | Return to directory node |
|
||||
| `t` | Go to top node of Info file |
|
||||
| `g` | Go to any node by name |
|
||||
| - | - |
|
||||
|-----|----------------------------------------|
|
||||
| `n` | Next node |
|
||||
| `p` | Previous node |
|
||||
| `u` | Move up |
|
||||
| `m` | Select menu item by name |
|
||||
| `n` | Select nth menu item by number (1–9) |
|
||||
| `f` | Follow cross reference (return with l) |
|
||||
| `l` | Return to last node you saw |
|
||||
| `d` | Return to directory node |
|
||||
| `t` | Go to top node of Info file |
|
||||
| `g` | Go to any node by name |
|
||||
{.shortcuts}
|
||||
|
||||
#### Other
|
||||
|
||||
| - | - |
|
||||
|---------|---------------------------------------------|
|
||||
| `h` | Run Info tutorial |
|
||||
| `i` | Look up a subject in the indices |
|
||||
| `s` | Search nodes for regexp |
|
||||
| `q` | Quit Info |
|
||||
| - | - |
|
||||
|-----|----------------------------------|
|
||||
| `h` | Run Info tutorial |
|
||||
| `i` | Look up a subject in the indices |
|
||||
| `s` | Search nodes for regexp |
|
||||
| `q` | Quit Info |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ When two commands are shown, the second is a similar command for a frame instead
|
||||
|
||||
### Minibuffer
|
||||
The following keys are defined in the minibuffer.
|
||||
| - | - |
|
||||
| - | - |
|
||||
|-------|-----------------------------------------|
|
||||
| `TAB` | Complete as much as possible |
|
||||
| `SPC` | Complete up to one word |
|
||||
@@ -316,10 +316,10 @@ Type `C-x` `ESC` `ESC` to edit and repeat the last command that used the minibuf
|
||||
|
||||
### Tags
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|--------------------------|--------------------------------------------|
|
||||
| `M-.` | Find a tag (a definition) |
|
||||
| `C-u` `M-.` | Find next occurrence of tag |
|
||||
| `C-u` `M-.` | Find next occurrence of tag |
|
||||
| `M-x` visit-tags-table | Specify a new tags file |
|
||||
| `M-x` tags-search | Regexp search on all files in tags table |
|
||||
| `M-x` tags-query-replace | Run query-replace on all the files |
|
||||
@@ -330,8 +330,8 @@ Type `C-x` `ESC` `ESC` to edit and repeat the last command that used the minibuf
|
||||
|
||||
### Rectangles
|
||||
|
||||
| - | - |
|
||||
|-----------|-------------------------------------|
|
||||
| - | - |
|
||||
|---------------|-------------------------------------|
|
||||
| `C-x` `r` `r` | Copy rectangle to register |
|
||||
| `C-x` `r` `k` | Kill rectangle |
|
||||
| `C-x` `r` `y` | Yank rectangle |
|
||||
@@ -344,12 +344,12 @@ Type `C-x` `ESC` `ESC` to edit and repeat the last command that used the minibuf
|
||||
|
||||
### Keyboard Macros
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|---------------------------|-------------------------------------|
|
||||
| `C-x` `(` | Start defining a keyboard macro |
|
||||
| `C-x` `)` | End keyboard macro definition |
|
||||
| `C-x` `e` | Execute last-defined keyboard macro |
|
||||
| `C-u` `C-x` `(` | Append to last keyboard macro |
|
||||
| `C-x` `(` | Start defining a keyboard macro |
|
||||
| `C-x` `)` | End keyboard macro definition |
|
||||
| `C-x` `e` | Execute last-defined keyboard macro |
|
||||
| `C-u` `C-x` `(` | Append to last keyboard macro |
|
||||
| `M-x` name-last-kbd-macro | Name last keyboard macro |
|
||||
| `M-x` insert-kbd-macro | Insert Lisp definition in buffer |
|
||||
{.shortcuts}
|
||||
@@ -359,8 +359,8 @@ Type `C-x` `ESC` `ESC` to edit and repeat the last command that used the minibuf
|
||||
|
||||
### Buffers
|
||||
|
||||
| - | - |
|
||||
|-----------|-----------------------|
|
||||
| - | - |
|
||||
|-------------|-----------------------|
|
||||
| `C-x` `b` | Select another buffer |
|
||||
| `C-x` `C-b` | List all buffers |
|
||||
| `C-x` `k` | Kill a buffer |
|
||||
@@ -375,45 +375,45 @@ Emacs Search{.cols-3}
|
||||
|
||||
### Regex (common) {.row-span-2}
|
||||
|
||||
| - | - |
|
||||
|-------------------|----------------------------------------------|
|
||||
| `.` `(dot)` | Any single character except a newline |
|
||||
| `*` | Zero or more repeats |
|
||||
| `+` | One or more repeats |
|
||||
| `?` | Zero or one repeat |
|
||||
| `\` | Quote special characters |
|
||||
| `\c` | Quote regular expression special character c |
|
||||
| `\|` | Alternative (“or”) |
|
||||
| - | - |
|
||||
|---------------|----------------------------------------------|
|
||||
| `.` `(dot)` | Any single character except a newline |
|
||||
| `*` | Zero or more repeats |
|
||||
| `+` | One or more repeats |
|
||||
| `?` | Zero or one repeat |
|
||||
| `\` | Quote special characters |
|
||||
| `\c` | Quote regular expression special character c |
|
||||
| `\|` | Alternative (“or”) |
|
||||
| `\(...\)` | Grouping |
|
||||
| `\(:?...\)` | Shy grouping |
|
||||
| `\(:NUM...\)` | Explicit numbered grouping |
|
||||
| `\n` | Same text as nth group |
|
||||
| `\b` | At word break |
|
||||
| `\B` | Not at word break |
|
||||
| `\n` | Same text as nth group |
|
||||
| `\b` | At word break |
|
||||
| `\B` | Not at word break |
|
||||
|
||||
### Regex (entry)
|
||||
| Start | End | Entity |
|
||||
|-------------|-----------|--------|
|
||||
| `^` | `$` | Line |
|
||||
| `\<` | `\>` | Word |
|
||||
| `\_<` | `\_>` | Symbol |
|
||||
| `\‘` | `\’` | Buffer |
|
||||
| Start | End | Entity |
|
||||
|-------|-------|--------|
|
||||
| `^` | `$` | Line |
|
||||
| `\<` | `\>` | Word |
|
||||
| `\_<` | `\_>` | Symbol |
|
||||
| `\‘` | `\’` | Buffer |
|
||||
{.show-header}
|
||||
|
||||
### Regex (conflict)
|
||||
|
||||
| These | Others | class |
|
||||
|-------------|--------------|---------------------------|
|
||||
| These | Others | class |
|
||||
|---------|----------|---------------------------|
|
||||
| `[...]` | `[^...]` | Explicit set |
|
||||
| `\w` | `\W` | Word-syntax character |
|
||||
| `\sc` | `\Sc` | Character with syntax c |
|
||||
| `\cc` | `\Cc` | Character with category c |
|
||||
| `\w` | `\W` | Word-syntax character |
|
||||
| `\sc` | `\Sc` | Character with syntax c |
|
||||
| `\cc` | `\Cc` | Character with category c |
|
||||
{.show-header}
|
||||
|
||||
|
||||
### Incremental Search
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|---------|-----------------------------------|
|
||||
| `C-s` | Search forward |
|
||||
| `C-r` | Search backward |
|
||||
@@ -433,17 +433,17 @@ Use `C-s` or `C-r` again to repeat the search in either direction. If Emacs is s
|
||||
|
||||
### Query Replace
|
||||
|
||||
| - | - |
|
||||
|----------------------------|--------------------------------------|
|
||||
| `M-%` | Interactively replace a text string |
|
||||
| `M-x` regexp | Using regular expressions |
|
||||
| `SPC` / `y` | Replace this one, go on to next |
|
||||
| `,` | Replace this one, don’t move |
|
||||
| `DEL` / `n` | Skip to next without replacing |
|
||||
| `!` | Replace all remaining matches |
|
||||
| `^` | Back up to the previous match |
|
||||
| `RET` | Exit query-replace |
|
||||
| `C-r` | Enter recursive edit (C-M-c to exit) |
|
||||
| - | - |
|
||||
|--------------|--------------------------------------|
|
||||
| `M-%` | Interactively replace a text string |
|
||||
| `M-x` regexp | Using regular expressions |
|
||||
| `SPC` / `y` | Replace this one, go on to next |
|
||||
| `,` | Replace this one, don’t move |
|
||||
| `DEL` / `n` | Skip to next without replacing |
|
||||
| `!` | Replace all remaining matches |
|
||||
| `^` | Back up to the previous match |
|
||||
| `RET` | Exit query-replace |
|
||||
| `C-r` | Enter recursive edit (C-M-c to exit) |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
@@ -454,25 +454,25 @@ Misc {.cols-3}
|
||||
|
||||
### Shells
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|-------------|----------------------------------------|
|
||||
| `M-!` | Execute a shell command |
|
||||
| `M-&` | Execute a shell command asynchronously |
|
||||
| `M-` | Run a shell command on the region |
|
||||
| `C-u` `M-` | Filter region through a shell command |
|
||||
| `M-x` shell | Start a shell in window shell |
|
||||
| `C-u` `M-` | Filter region through a shell command |
|
||||
| `M-x` shell | Start a shell in window shell |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
|
||||
### International Character Sets {.col-span-2}
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|----------------------------|------------------------------------|
|
||||
| `C-x` `RET` `l` | specify principal language |
|
||||
| `C-x` `RET` `l` | specify principal language |
|
||||
| `M-x` list-input-methods | show all input methods |
|
||||
| `C-\` | enable or disable input method |
|
||||
| `C-x` `RET` `c` | set coding system for next command |
|
||||
| `C-x` `RET` `c` | set coding system for next command |
|
||||
| `M-x` list-coding-systems | show all coding systems |
|
||||
| `M-x` prefer-coding-system | choose preferred coding system |
|
||||
{.shortcuts}
|
||||
@@ -480,8 +480,8 @@ Misc {.cols-3}
|
||||
|
||||
### Registers
|
||||
|
||||
| - | - |
|
||||
|-------------|--------------------------------------|
|
||||
| - | - |
|
||||
|-----------------|--------------------------------------|
|
||||
| `C-x` `r` `s` | Save region in register |
|
||||
| `C-x` `r` `i` | Insert register contents into buffer |
|
||||
| `C-x` `r` `SPC` | Save value of point in register |
|
||||
@@ -493,7 +493,7 @@ Misc {.cols-3}
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|------------|-------------------|
|
||||
| `C-u` num | Numeric argument |
|
||||
| `M--` | Negative argument |
|
||||
@@ -504,9 +504,9 @@ Misc {.cols-3}
|
||||
|
||||
### Commands Dealing with Emacs Lisp
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|--------------------|------------------------------------|
|
||||
| `C-x` `C-e` | Eval sexp before point |
|
||||
| `C-x` `C-e` | Eval sexp before point |
|
||||
| `C-M-x` | Eval current defun |
|
||||
| `M-x` eval-region | Eval region |
|
||||
| `M-:` | Read and eval minibuffer |
|
||||
@@ -518,8 +518,8 @@ Misc {.cols-3}
|
||||
|
||||
### Simple Customization
|
||||
|
||||
| - | - |
|
||||
|-----------------|-------------------------------|
|
||||
| - | - |
|
||||
|-------------------|-------------------------------|
|
||||
| `M-x` `customize` | customize variables and faces |
|
||||
|
||||
Making global key bindings in Emacs Lisp:
|
||||
@@ -534,14 +534,14 @@ Making global key bindings in Emacs Lisp:
|
||||
|
||||
### Abbrevs
|
||||
|
||||
| - | - |
|
||||
|-------------|------------------------------------------|
|
||||
| `C-x` `a` `g` | Add global abbrev |
|
||||
| `C-x` `a` `l` | Add mode-local abbrev |
|
||||
| - | - |
|
||||
|-------------------|------------------------------------------|
|
||||
| `C-x` `a` `g` | Add global abbrev |
|
||||
| `C-x` `a` `l` | Add mode-local abbrev |
|
||||
| `C-x` `a` `i` `g` | Add global expansion for this abbrev |
|
||||
| `C-x` `a` `i` `l` | Add mode-local expansion for this abbrev |
|
||||
| `C-x` `a` `e` | Explicitly expand abbrev |
|
||||
| `M-/` | Expand previous word dynamically |
|
||||
| `C-x` `a` `e` | Explicitly expand abbrev |
|
||||
| `M-/` | Expand previous word dynamically |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
@@ -549,7 +549,7 @@ Making global key bindings in Emacs Lisp:
|
||||
|
||||
### Spelling Check
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|---------------------|---------------------------------------|
|
||||
| `M-$` | Check spelling of current word |
|
||||
| `M-x` ispell-region | Check spelling of all words in region |
|
||||
|
||||
@@ -34,16 +34,16 @@ $ find . -name "json_*"
|
||||
- [Find cheatsheet](https://gist.github.com/gr1ev0us/3a9b9d9dbdd38f6379288eb2686fc538) _(gist.github.com)_
|
||||
|
||||
### Option Examples {.col-span-2}
|
||||
| Option | Example | Description |
|
||||
|-------------|---------------------------------------------|--------------------------------------------------------|
|
||||
| `-type` | find . -type d | Find only directories |
|
||||
| `-name` | find . -type f -name "*.txt" | Find file by name |
|
||||
| `-iname` | find . -type f -iname "hello" | Find file by name (case-insensitive) |
|
||||
| `-size` | find . -size +1G | Find files larger than 1G |
|
||||
| `-user` | find . -type d -user jack | Find jack's file |
|
||||
| `-regex` | find /var -regex '.\*/tmp/.\*[0-9]*.file' | Using Regex with find. See [regex](/regex) |
|
||||
| `-maxdepth` | find . -maxdepth 1 -name "a.txt" | In the current directory and subdirectories |
|
||||
| `-mindepth` | find / -mindepth 3 -maxdepth 5 -name pass | Between sub-directory level 2 and 4 |
|
||||
| Option | Example | Description |
|
||||
|-------------|-------------------------------------------|---------------------------------------------|
|
||||
| `-type` | find . -type d | Find only directories |
|
||||
| `-name` | find . -type f -name "*.txt" | Find file by name |
|
||||
| `-iname` | find . -type f -iname "hello" | Find file by name (case-insensitive) |
|
||||
| `-size` | find . -size +1G | Find files larger than 1G |
|
||||
| `-user` | find . -type d -user jack | Find jack's file |
|
||||
| `-regex` | find /var -regex '.\*/tmp/.\*[0-9]*.file' | Using Regex with find. See [regex](/regex) |
|
||||
| `-maxdepth` | find . -maxdepth 1 -name "a.txt" | In the current directory and subdirectories |
|
||||
| `-mindepth` | find / -mindepth 3 -maxdepth 5 -name pass | Between sub-directory level 2 and 4 |
|
||||
{.show-header}
|
||||
|
||||
|
||||
@@ -223,11 +223,11 @@ Find Date and Time {.cols-3}
|
||||
|
||||
|
||||
### Means {.col-span-2}
|
||||
| Option | Description |
|
||||
|-----------------|------------------------------------------------------------|
|
||||
| Option | Description |
|
||||
|---------|-----------------------------------------------------------------|
|
||||
| `atime` | access time (last time file <yel>opened</yel>) |
|
||||
| `mtime` | modified time (last time file <yel>contents was modified</yel>) |
|
||||
| `ctime` | changed time (last time file <yel>inode was changed</yel>) |
|
||||
| `ctime` | changed time (last time file <yel>inode was changed</yel>) |
|
||||
#### Example
|
||||
| Option | Description |
|
||||
|-----------------|------------------------------------------------------------|
|
||||
|
||||
@@ -366,8 +366,8 @@ See also: [fmt](https://golang.org/pkg/fmt/)
|
||||
|
||||
|
||||
### Function examples
|
||||
| Example | Result |
|
||||
|-------------------------------|---------------|
|
||||
| Example | Result |
|
||||
|-------------------------------|-------------|
|
||||
| Contains("test", "es") | true |
|
||||
| Count("test", "t") | 2 |
|
||||
| HasPrefix("test", "te") | true |
|
||||
@@ -1031,14 +1031,14 @@ Miscellaneous {.cols-3}
|
||||
{.cols-3 .style-none}
|
||||
|
||||
### Operators and punctuation
|
||||
| | | | | | | | | |
|
||||
|---|----|-----|-----|------|----|-----|----|---|
|
||||
| + | & | += | &= | && | == | != | ( | ) |
|
||||
| - | \| | -= | \|= | \|\| | < | <= | [ | ] |
|
||||
| * | ^ | *= | ^= | <- | > | >= | { | } |
|
||||
| / | << | /= | <<= | ++ | = | := | , | ; |
|
||||
| % | >> | %= | >>= | -- | ! | ... | . | : |
|
||||
| | &^ | &^= | | | | | | |
|
||||
| | | | | | | | | |
|
||||
|---|----|-----|-----|------|----|-----|---|---|
|
||||
| + | & | += | &= | && | == | != | ( | ) |
|
||||
| - | \| | -= | \|= | \|\| | < | <= | [ | ] |
|
||||
| * | ^ | *= | ^= | <- | > | >= | { | } |
|
||||
| / | << | /= | <<= | ++ | = | := | , | ; |
|
||||
| % | >> | %= | >>= | -- | ! | ... | . | : |
|
||||
| | &^ | &^= | | | | | | |
|
||||
|
||||
|
||||
|
||||
|
||||
+12
-12
@@ -31,24 +31,24 @@ Getting started {.cols-3}
|
||||
|
||||
### Schema
|
||||
|
||||
| | |
|
||||
|---------------|-----------------------------------------|
|
||||
| `schema` | GraphQL schema definition |
|
||||
| `query` | Read and traverse data |
|
||||
| `mutation` | Modify data or trigger an action |
|
||||
| `subscription`| Run a query when an event occurs |
|
||||
| | |
|
||||
|----------------|----------------------------------|
|
||||
| `schema` | GraphQL schema definition |
|
||||
| `query` | Read and traverse data |
|
||||
| `mutation` | Modify data or trigger an action |
|
||||
| `subscription` | Run a query when an event occurs |
|
||||
|
||||
|
||||
|
||||
### Built-in Scalar Types
|
||||
|
||||
| | |
|
||||
|-----------|---------|
|
||||
| `Int` | Signed 32‐bit integer |
|
||||
| | |
|
||||
|-----------|----------------------------------------------|
|
||||
| `Int` | Signed 32‐bit integer |
|
||||
| `Float` | Signed double-precision floating-point value |
|
||||
| `String` | UTF‐8 character sequence |
|
||||
| `Boolean` | true or false |
|
||||
| `ID` | A Unique identifier |
|
||||
| `String` | UTF‐8 character sequence |
|
||||
| `Boolean` | true or false |
|
||||
| `ID` | A Unique identifier |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -39,21 +39,21 @@ Wildcards are accepted in filename.
|
||||
|
||||
### Option examples {.col-span-3}
|
||||
|
||||
| Option | Example | Operation |
|
||||
|---------|-------------------------------------------|-------------------------------------------------|
|
||||
| `-i` | grep -i ^DA demo.txt | Forgets about case sensitivity |
|
||||
| `-w` | grep -w "of" demo.txt | Search only for the full word |
|
||||
| `-A` | grep -A 3 'Exception' error.log | Display 3 lines after matching string |
|
||||
| `-B` | grep -B 4 'Exception' error.log | Display 4 lines before matching string |
|
||||
| `-C` | grep -C 5 'Exception' error.log | Display 5 lines around matching string |
|
||||
| `-r` | grep -r 'quickref.me' /var/log/nginx/ | Recursive search _(within subdirs)_ |
|
||||
| `-v` | grep -v 'warning' /var/log/syslog | Return all lines which don't match the pattern |
|
||||
| `-e` | grep -e '^al' filename | Use regex _(lines starting with 'al')_ |
|
||||
| `-E` | grep -E 'ja(s\|cks)on' filename | Extended regex _(lines containing jason or jackson)_ |
|
||||
| `-c` | grep -c 'error' /var/log/syslog | Count the number of matches |
|
||||
| `-l` | grep -l 'robot' /var/log/* | Print the name of the file(s) of matches |
|
||||
| `-o` | grep -o search_string filename | Only show the matching part of the string |
|
||||
| `-n` | grep -n "go" demo.txt | Show the line numbers of the matches |
|
||||
| Option | Example | Operation |
|
||||
|--------|---------------------------------------|------------------------------------------------------|
|
||||
| `-i` | grep -i ^DA demo.txt | Forgets about case sensitivity |
|
||||
| `-w` | grep -w "of" demo.txt | Search only for the full word |
|
||||
| `-A` | grep -A 3 'Exception' error.log | Display 3 lines after matching string |
|
||||
| `-B` | grep -B 4 'Exception' error.log | Display 4 lines before matching string |
|
||||
| `-C` | grep -C 5 'Exception' error.log | Display 5 lines around matching string |
|
||||
| `-r` | grep -r 'quickref.me' /var/log/nginx/ | Recursive search _(within subdirs)_ |
|
||||
| `-v` | grep -v 'warning' /var/log/syslog | Return all lines which don't match the pattern |
|
||||
| `-e` | grep -e '^al' filename | Use regex _(lines starting with 'al')_ |
|
||||
| `-E` | grep -E 'ja(s\|cks)on' filename | Extended regex _(lines containing jason or jackson)_ |
|
||||
| `-c` | grep -c 'error' /var/log/syslog | Count the number of matches |
|
||||
| `-l` | grep -l 'robot' /var/log/* | Print the name of the file(s) of matches |
|
||||
| `-o` | grep -o search_string filename | Only show the matching part of the string |
|
||||
| `-n` | grep -n "go" demo.txt | Show the line numbers of the matches |
|
||||
|
||||
|
||||
Grep regular expressions {.cols-3}
|
||||
@@ -67,16 +67,16 @@ Please refer to the full version of the regex cheat sheet for more complex requi
|
||||
|
||||
### Wildcards
|
||||
|
||||
| - | - |
|
||||
|-----------------|----------------------------------------------|
|
||||
| . | Any character. |
|
||||
| `? ` | Optional and can only occur once. |
|
||||
| `* ` | Optional and can occur more than once. |
|
||||
| `+ ` | Required and can occur more than once. |
|
||||
| - | - |
|
||||
|-----------------|----------------------------------------|
|
||||
| . | Any character. |
|
||||
| `? ` | Optional and can only occur once. |
|
||||
| `* ` | Optional and can occur more than once. |
|
||||
| `+ ` | Required and can occur more than once. |
|
||||
|
||||
### Quantifiers
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|-----------------|----------------------------------------------|
|
||||
| `{n} ` | Previous item appears exactly n times. |
|
||||
| `{n,} ` | Previous item appears n times or more. |
|
||||
@@ -84,26 +84,26 @@ Please refer to the full version of the regex cheat sheet for more complex requi
|
||||
| `{n,m} ` | Previous item appears between n and m times. |
|
||||
|
||||
### POSIX
|
||||
| - | - |
|
||||
|-----------------|----------------------------------------------|
|
||||
| `[:alpha:] ` | Any lower and upper case letter. |
|
||||
| `[:digit:] ` | Any number. |
|
||||
| `[:alnum:] ` | Any lower and upper case letter or digit. |
|
||||
| `[:space:] ` | Any whitespace. |
|
||||
| - | - |
|
||||
|-----------------|-------------------------------------------|
|
||||
| `[:alpha:] ` | Any lower and upper case letter. |
|
||||
| `[:digit:] ` | Any number. |
|
||||
| `[:alnum:] ` | Any lower and upper case letter or digit. |
|
||||
| `[:space:] ` | Any whitespace. |
|
||||
|
||||
### Character
|
||||
|
||||
| - | - |
|
||||
|-----------------|----------------------------------------------|
|
||||
| `[A-Za-z] ` | Any lower and upper case letter. |
|
||||
| `[0-9] ` | Any number. |
|
||||
| `[0-9A-Za-z]` | Any lower and upper case letter or digit. |
|
||||
| - | - |
|
||||
|-----------------|-------------------------------------------|
|
||||
| `[A-Za-z] ` | Any lower and upper case letter. |
|
||||
| `[0-9] ` | Any number. |
|
||||
| `[0-9A-Za-z]` | Any lower and upper case letter or digit. |
|
||||
|
||||
|
||||
### Position
|
||||
|
||||
| | |
|
||||
|----|--------------------|
|
||||
| | |
|
||||
|------|--------------------|
|
||||
| `^ ` | Beginning of line. |
|
||||
| `$ ` | End of line. |
|
||||
| `^$` | Empty line. |
|
||||
|
||||
@@ -67,10 +67,10 @@ See: [The Paragraph element](https://developer.mozilla.org/en-US/docs/Web/HTML/E
|
||||
```
|
||||
---
|
||||
|
||||
| | | |
|
||||
|---|----------|----------------------------------------------------|
|
||||
| | `href` | The URL that the hyperlink points to |
|
||||
| | `rel` | Relationship of the linked URL |
|
||||
| | | |
|
||||
|---|----------|-----------------------------------------------------------------|
|
||||
| | `href` | The URL that the hyperlink points to |
|
||||
| | `rel` | Relationship of the linked URL |
|
||||
| | `target` | Link target location: <br/>`_self`, `_blank`, `_top`, `_parent` |
|
||||
{.left-text}
|
||||
|
||||
@@ -85,13 +85,13 @@ See: [The \<a> Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Ele
|
||||
```
|
||||
---
|
||||
|
||||
| | | |
|
||||
|---|----------|-------------------------------------|
|
||||
| | `src` | Required, Image location _(URL \| Path)_ |
|
||||
| | `alt` | Describe of the image |
|
||||
| | `width` | Width of the image |
|
||||
| | `height` | Height of the image |
|
||||
| | `loading`| How the browser should load |
|
||||
| | | |
|
||||
|---|-----------|------------------------------------------|
|
||||
| | `src` | Required, Image location _(URL \| Path)_ |
|
||||
| | `alt` | Describe of the image |
|
||||
| | `width` | Width of the image |
|
||||
| | `height` | Height of the image |
|
||||
| | `loading` | How the browser should load |
|
||||
{.left-text}
|
||||
|
||||
See: [The Image Embed element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img)
|
||||
@@ -399,11 +399,11 @@ HTML Tables {.cols-3}
|
||||
|
||||
### \<td> Attributes
|
||||
|
||||
| Attribute | Description |
|
||||
|-------------|-----------------------------------------------|
|
||||
| `colspan` | Number of columns a cell should span |
|
||||
| `headers` | One or more header cells a cell is related to |
|
||||
| `rowspan` | Number of rows a cell should span |
|
||||
| Attribute | Description |
|
||||
|-----------|-----------------------------------------------|
|
||||
| `colspan` | Number of columns a cell should span |
|
||||
| `headers` | One or more header cells a cell is related to |
|
||||
| `rowspan` | Number of rows a cell should span |
|
||||
|
||||
See: [td\#Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attributes)
|
||||
|
||||
@@ -411,13 +411,13 @@ See: [td\#Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/
|
||||
|
||||
### \<th> Attributes
|
||||
|
||||
| Attribute | Description |
|
||||
|-------------|-----------------------------------------------|
|
||||
| `colspan` | Number of columns a cell should span |
|
||||
| `headers` | One or more header cells a cell is related to |
|
||||
| `rowspan` | Number of rows a cell should span |
|
||||
| `abbr` | Description of the cell's content |
|
||||
| [scope](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope) | The header element relates to |
|
||||
| Attribute | Description |
|
||||
|----------------------------------------------------------------------------------|-----------------------------------------------|
|
||||
| `colspan` | Number of columns a cell should span |
|
||||
| `headers` | One or more header cells a cell is related to |
|
||||
| `rowspan` | Number of rows a cell should span |
|
||||
| `abbr` | Description of the cell's content |
|
||||
| [scope](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope) | The header element relates to |
|
||||
|
||||
See: [th\#Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attributes)
|
||||
|
||||
@@ -504,14 +504,14 @@ The HTML `<form>` element is used to collect and send information to an external
|
||||
|
||||
|
||||
### Form Attribute
|
||||
| Attribute | Description |
|
||||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `name` | Name of form for scripting |
|
||||
| `action` | URL of form script |
|
||||
| `method` | HTTP method, `POST` / `GET` _(default)_ |
|
||||
| `enctype` | Media type, See [enctype](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/enctype) |
|
||||
| `onsubmit` | Runs when the form was submit |
|
||||
| `onreset` | Runs when the form was reset |
|
||||
| Attribute | Description |
|
||||
|------------|-----------------------------------------------------------------------------------------------------|
|
||||
| `name` | Name of form for scripting |
|
||||
| `action` | URL of form script |
|
||||
| `method` | HTTP method, `POST` / `GET` _(default)_ |
|
||||
| `enctype` | Media type, See [enctype](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/enctype) |
|
||||
| `onsubmit` | Runs when the form was submit |
|
||||
| `onreset` | Runs when the form was reset |
|
||||
|
||||
|
||||
|
||||
@@ -715,31 +715,31 @@ The input tag is an empty element, identifying the particular type of field info
|
||||
|
||||
----
|
||||
|
||||
| - | | |
|
||||
|---|-------------------------|-------------------------------------------------|
|
||||
| | `type="…"` | The type of data that is being input |
|
||||
| | `value="…"` | Default value |
|
||||
| | `name="…"` | Used to describe this data in the HTTP request |
|
||||
| | `id="…"` | Unique identifier that other HTML elements |
|
||||
| | `readonly` | Stops the user from modifying |
|
||||
| | `disabled` | Stops any interaction |
|
||||
| | `checked` | The radio or checkbox select or not |
|
||||
| | `required` | Being compulsory, See [required](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required#example) |
|
||||
| | `placeholder="…"` | Adds a temporary, See [::placeholder](https://developer.mozilla.org/en-US/docs/Web/CSS/::placeholder#examples) |
|
||||
| | `autocomplete="off"` | Disable auto completion |
|
||||
| | `autocapitalize="none"` | Disable auto capitalization |
|
||||
| | `inputmode="…"` | Display a specific keyboard, See [inputmode](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode) |
|
||||
| | `list="…"` | The id of an associated [datalist](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) |
|
||||
| | `maxlength="…"` | Maximum number of characters |
|
||||
| | `minlength="…"` | Minimum number of characters |
|
||||
| | `min="…"` | Minimum numerical value on range & number |
|
||||
| | `max="…"` | Maximum numerical value on range & number |
|
||||
| | `step="…"` | How the number will increment in range & number |
|
||||
| | `pattern="…"` | Specifies a [Regular expression](/regex), See [pattern](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern) |
|
||||
| | `autofocus` | Be focused |
|
||||
| | `spellcheck` | Perform spell checking |
|
||||
| | `multiple` | Whether to allow [multiple](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple) values |
|
||||
| | `accept=""` | Expected file type in [file](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file) upload controls |
|
||||
| - | | |
|
||||
|---|-------------------------|-------------------------------------------------------------------------------------------------------------------------------|
|
||||
| | `type="…"` | The type of data that is being input |
|
||||
| | `value="…"` | Default value |
|
||||
| | `name="…"` | Used to describe this data in the HTTP request |
|
||||
| | `id="…"` | Unique identifier that other HTML elements |
|
||||
| | `readonly` | Stops the user from modifying |
|
||||
| | `disabled` | Stops any interaction |
|
||||
| | `checked` | The radio or checkbox select or not |
|
||||
| | `required` | Being compulsory, See [required](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required#example) |
|
||||
| | `placeholder="…"` | Adds a temporary, See [::placeholder](https://developer.mozilla.org/en-US/docs/Web/CSS/::placeholder#examples) |
|
||||
| | `autocomplete="off"` | Disable auto completion |
|
||||
| | `autocapitalize="none"` | Disable auto capitalization |
|
||||
| | `inputmode="…"` | Display a specific keyboard, See [inputmode](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode) |
|
||||
| | `list="…"` | The id of an associated [datalist](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) |
|
||||
| | `maxlength="…"` | Maximum number of characters |
|
||||
| | `minlength="…"` | Minimum number of characters |
|
||||
| | `min="…"` | Minimum numerical value on range & number |
|
||||
| | `max="…"` | Maximum numerical value on range & number |
|
||||
| | `step="…"` | How the number will increment in range & number |
|
||||
| | `pattern="…"` | Specifies a [Regular expression](/regex), See [pattern](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern) |
|
||||
| | `autofocus` | Be focused |
|
||||
| | `spellcheck` | Perform spell checking |
|
||||
| | `multiple` | Whether to allow [multiple](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple) values |
|
||||
| | `accept=""` | Expected file type in [file](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file) upload controls |
|
||||
{.left-text}
|
||||
|
||||
Also see: [Attributes for the \<input> element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes)
|
||||
@@ -747,41 +747,41 @@ Also see: [Attributes for the \<input> element](https://developer.mozilla.org/en
|
||||
|
||||
### Input types
|
||||
|
||||
| | |
|
||||
|-------------------------|--------------------------------------------------------------|
|
||||
| `type="checkbox"` | <input type="checkbox" class="border border-gray-400"> |
|
||||
| `type="radio"` | <input type="radio" class="border border-gray-400"> |
|
||||
| `type="file"` | <input type="file" class="border border-gray-400"> |
|
||||
| `type="hidden"` | <input type="hidden" class="border border-gray-400"> |
|
||||
| `type="text"` | <input type="text" class="border border-gray-400"> |
|
||||
| `type="password"` | <input type="password" class="border border-gray-400"> |
|
||||
| `type="image"` | <input type="image" src="https://raw.githubusercontent.com/mdn/learning-area/master/html/forms/image-type-example/login.png" width="70"> |
|
||||
| `type="reset"` | <input type="reset" class="border border-gray-400"> |
|
||||
| `type="button"` | <input type="button" class="border border-gray-400">Button</input> |
|
||||
| `type="submit"` | <input type="submit" class="border border-gray-400"> |
|
||||
| | |
|
||||
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `type="checkbox"` | <input type="checkbox" class="border border-gray-400"> |
|
||||
| `type="radio"` | <input type="radio" class="border border-gray-400"> |
|
||||
| `type="file"` | <input type="file" class="border border-gray-400"> |
|
||||
| `type="hidden"` | <input type="hidden" class="border border-gray-400"> |
|
||||
| `type="text"` | <input type="text" class="border border-gray-400"> |
|
||||
| `type="password"` | <input type="password" class="border border-gray-400"> |
|
||||
| `type="image"` | <input type="image" src="https://raw.githubusercontent.com/mdn/learning-area/master/html/forms/image-type-example/login.png" width="70"> |
|
||||
| `type="reset"` | <input type="reset" class="border border-gray-400"> |
|
||||
| `type="button"` | <input type="button" class="border border-gray-400">Button</input> |
|
||||
| `type="submit"` | <input type="submit" class="border border-gray-400"> |
|
||||
|
||||
#### New Input Types in HTML5
|
||||
| | |
|
||||
|-------------------------|--------------------------------------------------------------|
|
||||
| `type="color"` | <input type="color" value="#0FB881" class="border border-gray-400"> |
|
||||
| `type="date"` | <input type="date" class="border border-gray-400"> |
|
||||
| `type="time"` | <input type="time" class="border border-gray-400"> |
|
||||
| `type="month"` | <input type="month" class="border border-gray-400"> |
|
||||
| `type="datetime-local"` | <input type="datetime-local" class="border border-gray-400"> |
|
||||
| `type="week"` | <input type="week" class="border border-gray-400"> |
|
||||
| `type="email"` | <input type="email" class="border border-gray-400"> |
|
||||
| `type="tel"` | <input type="tel" class="border border-gray-400"> |
|
||||
| `type="url"` | <input type="url" class="border border-gray-400"> |
|
||||
| `type="number"` | <input type="number" class="border border-gray-400"> |
|
||||
| `type="search"` | <input type="search" class="border border-gray-400"> |
|
||||
| `type="range"` | <input type="range" class="border border-gray-400"> |
|
||||
| | |
|
||||
|-------------------------|---------------------------------------------------------------------|
|
||||
| `type="color"` | <input type="color" value="#0FB881" class="border border-gray-400"> |
|
||||
| `type="date"` | <input type="date" class="border border-gray-400"> |
|
||||
| `type="time"` | <input type="time" class="border border-gray-400"> |
|
||||
| `type="month"` | <input type="month" class="border border-gray-400"> |
|
||||
| `type="datetime-local"` | <input type="datetime-local" class="border border-gray-400"> |
|
||||
| `type="week"` | <input type="week" class="border border-gray-400"> |
|
||||
| `type="email"` | <input type="email" class="border border-gray-400"> |
|
||||
| `type="tel"` | <input type="tel" class="border border-gray-400"> |
|
||||
| `type="url"` | <input type="url" class="border border-gray-400"> |
|
||||
| `type="number"` | <input type="number" class="border border-gray-400"> |
|
||||
| `type="search"` | <input type="search" class="border border-gray-400"> |
|
||||
| `type="range"` | <input type="range" class="border border-gray-400"> |
|
||||
|
||||
|
||||
### Input CSS selectors
|
||||
|
||||
| | |
|
||||
|------------------|------------------------------------------------|
|
||||
| `input:focus` | When its keyboard focused |
|
||||
| | |
|
||||
|---------------|---------------------------|
|
||||
| `input:focus` | When its keyboard focused |
|
||||
See: [Input pseudo classes](/css#input-pseudo-classes)
|
||||
|
||||
|
||||
|
||||
@@ -54,10 +54,10 @@ String site = "quickref.me";
|
||||
| `short` | 2 byte | 0 | -2^15^ ^to^ 2^15^-1 |
|
||||
| `int` | 4 byte | 0 | -2^31^ ^to^ 2^31^-1 |
|
||||
| `long` | 8 byte | 0 | -2^63^ ^to^ 2^63^-1 |
|
||||
| `float` | 4 byte | 0.0f |_N/A_ |
|
||||
| `double` | 8 byte | 0.0d |_N/A_ |
|
||||
| `float` | 4 byte | 0.0f | _N/A_ |
|
||||
| `double` | 8 byte | 0.0d | _N/A_ |
|
||||
| `char` | 2 byte | \\u0000 | 0 ^to^ 65535 |
|
||||
| `boolean` |_N/A_ | false | true / false |
|
||||
| `boolean` | _N/A_ | false | true / false |
|
||||
{.show-header}
|
||||
|
||||
|
||||
@@ -747,21 +747,21 @@ multi-line comment!
|
||||
|
||||
### Math methods
|
||||
|
||||
| Method | Description |
|
||||
|-----------------------|-----------------------------|
|
||||
| `Math.max(a,b)` | Maximum of a and b |
|
||||
| `Math.min(a,b)` | Minimum of a and b |
|
||||
| `Math.abs(a)` | Absolute value a |
|
||||
| `Math.sqrt(a)` | Square-root of a |
|
||||
| `Math.pow(a,b)` | Power of b |
|
||||
| `Math.round(a)` | Closest integer |
|
||||
| `Math.sin(ang)` | Sine of ang |
|
||||
| `Math.cos(ang)` | Cosine of ang |
|
||||
| `Math.tan(ang)` | Tangent of ang |
|
||||
| `Math.asin(ang)` | Inverse sine of ang |
|
||||
| `Math.log(a)` | Natural logarithm of a |
|
||||
| `Math.toDegrees(rad)` | Angle rad in degrees |
|
||||
| `Math.toRadians(deg)` | Angle deg in radians |
|
||||
| Method | Description |
|
||||
|-----------------------|------------------------|
|
||||
| `Math.max(a,b)` | Maximum of a and b |
|
||||
| `Math.min(a,b)` | Minimum of a and b |
|
||||
| `Math.abs(a)` | Absolute value a |
|
||||
| `Math.sqrt(a)` | Square-root of a |
|
||||
| `Math.pow(a,b)` | Power of b |
|
||||
| `Math.round(a)` | Closest integer |
|
||||
| `Math.sin(ang)` | Sine of ang |
|
||||
| `Math.cos(ang)` | Cosine of ang |
|
||||
| `Math.tan(ang)` | Tangent of ang |
|
||||
| `Math.asin(ang)` | Inverse sine of ang |
|
||||
| `Math.log(a)` | Natural logarithm of a |
|
||||
| `Math.toDegrees(rad)` | Angle rad in degrees |
|
||||
| `Math.toRadians(deg)` | Angle deg in radians |
|
||||
|
||||
### Try/Catch/Finally
|
||||
```java
|
||||
|
||||
@@ -72,7 +72,7 @@ Getting started {.cols-3}
|
||||
| `\f` | Form feed |
|
||||
| `\n` | Newline |
|
||||
| `\r` | Carriage return |
|
||||
| `\t` | Tab |
|
||||
| `\t` | Tab |
|
||||
| `\u` | Trailed by four hex digits |
|
||||
|
||||
#### Examples
|
||||
@@ -96,7 +96,7 @@ Have to be delimited by double quotes
|
||||
| Type | Description |
|
||||
|------------|----------------------------------------|
|
||||
| `Integer` | Digits 1-9, 0 and positive or negative |
|
||||
| `Fraction` | Fractions like 0.3, 3.9 |
|
||||
| `Fraction` | Fractions like 0.3, 3.9 |
|
||||
| `Exponent` | Exponent like e, e+, e-, E, E+, E |
|
||||
|
||||
#### Examples
|
||||
@@ -227,13 +227,13 @@ let myObject = {
|
||||
```
|
||||
----
|
||||
|
||||
| | |
|
||||
|----------------------|-----------|
|
||||
| `myObject.name` | "Jason" |
|
||||
| `myObject["name"]` | "Jason" |
|
||||
| `myObject.age` | 39 |
|
||||
| `myObject.other` | undefined |
|
||||
| `myObject[0]` | undefined |
|
||||
| | |
|
||||
|--------------------|-----------|
|
||||
| `myObject.name` | "Jason" |
|
||||
| `myObject["name"]` | "Jason" |
|
||||
| `myObject.age` | 39 |
|
||||
| `myObject.other` | undefined |
|
||||
| `myObject[0]` | undefined |
|
||||
|
||||
|
||||
|
||||
|
||||
+9
-9
@@ -182,16 +182,16 @@ console.log("This is a block code")
|
||||
```markdown
|
||||
| Left column | Center column | Right column |
|
||||
|:------------|:-------------:|-------------:|
|
||||
| Cell 1 | Centered | $1600 |
|
||||
| Cell 2 | Cell 3 | $12 |
|
||||
| Cell 1 | Centered | $1600 |
|
||||
| Cell 2 | Cell 3 | $12 |
|
||||
```
|
||||
|
||||
Simple style
|
||||
```markdown
|
||||
Left column | Center column | Right column
|
||||
:---:|:---:|:---:
|
||||
Cell 1 | Centered | $1600
|
||||
Cell 2 | Cell 3 | $12
|
||||
Left column | Center column | Right column
|
||||
:----------:|:-------------:|:-----------:
|
||||
Cell 1 | Centered | $1600
|
||||
Cell 2 | Cell 3 | $12
|
||||
```
|
||||
A markdown table generator: [tableconvert.com](https://tableconvert.com/)
|
||||
|
||||
@@ -222,9 +222,9 @@ A markdown table generator: [tableconvert.com](https://tableconvert.com/)
|
||||
|
||||
### Backslash escapes
|
||||
|
||||
| Characters | Escape | Description |
|
||||
|------------|--------|-----------------------|
|
||||
| \\ | \\\\ | backslash |
|
||||
| Characters | Escape | Description |
|
||||
|------------|--------|-------------|
|
||||
| \\ | \\\\ | backslash |
|
||||
| \` | \\\` | backtick |
|
||||
| \* | \\\* | asterisk |
|
||||
| \_ | \\\_ | underscore |
|
||||
|
||||
@@ -10,79 +10,79 @@ intro: |
|
||||
---
|
||||
|
||||
### Common MIME (Media) types
|
||||
| Extension | Kind of document | MIME Type \(Content Type\) |
|
||||
|------------------|--------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| \.aac | AAC audio | audio/aac |
|
||||
| \.abw | AbiWord document | application/x\-abiword |
|
||||
| \.arc | Archive document \(multiple files embedded\) | application/x\-freearc |
|
||||
| \.avi | AVI: Audio Video Interleave | video/x\-msvideo |
|
||||
| \.azw | Amazon Kindle eBook format | application/vnd\.amazon\.ebook |
|
||||
| \.bin | Any kind of binary data | application/octet\-stream |
|
||||
| \.bmp | Windows OS/2 Bitmap Graphics | image/bmp |
|
||||
| \.bz | BZip archive | application/x\-bzip |
|
||||
| \.bz2 | BZip2 archive | application/x\-bzip2 |
|
||||
| \.csh | C\-Shell script | application/x\-csh |
|
||||
| \.css | Cascading Style Sheets \(CSS\) | text/css |
|
||||
| \.csv | Comma\-separated values \(CSV\) | text/csv |
|
||||
| \.doc | Microsoft Word | application/msword |
|
||||
| \.docx | Microsoft Word \(OpenXML\) | application/vnd\.openxmlformats\-officedocument\.wordprocessingml\.document |
|
||||
| \.eot | MS Embedded OpenType fonts | application/vnd\.ms\-fontobject |
|
||||
| \.epub | Electronic publication \(EPUB\) | application/epub\+zip |
|
||||
| \.gz | GZip Compressed Archive | application/gzip |
|
||||
| \.gif | Graphics Interchange Format \(GIF\) | image/gif |
|
||||
| \.htm \.html | HyperText Markup Language \(HTML\) | text/html |
|
||||
| \.ico | Icon format | image/vnd\.microsoft\.icon |
|
||||
| \.ics | iCalendar format | text/calendar |
|
||||
| \.jar | Java Archive \(JAR\) | application/java\-archive |
|
||||
| \.jpeg \.jpg | JPEG images | image/jpeg |
|
||||
| \.js | JavaScript | text/javascript |
|
||||
| \.json | JSON format | application/json |
|
||||
| \.jsonld | JSON\-LD format | application/ld\+json |
|
||||
| \.mid \.midi | Musical Instrument Digital Interface \(MIDI\) | audio/midi audio/x\-midi |
|
||||
| \.mjs | JavaScript module | text/javascript |
|
||||
| \.mp3 | MP3 audio | audio/mpeg |
|
||||
| \.mpeg | MPEG Video | video/mpeg |
|
||||
| \.mpkg | Apple Installer Package | application/vnd\.apple\.installer\+xml |
|
||||
| \.odp | OpenDocument presentation document | application/vnd\.oasis\.opendocument\.presentation |
|
||||
| \.ods | OpenDocument spreadsheet document | application/vnd\.oasis\.opendocument\.spreadsheet |
|
||||
| \.odt | OpenDocument text document | application/vnd\.oasis\.opendocument\.text |
|
||||
| \.oga | OGG audio | audio/ogg |
|
||||
| \.ogv | OGG video | video/ogg |
|
||||
| \.ogx | OGG | application/ogg |
|
||||
| \.opus | Opus audio | audio/opus |
|
||||
| \.otf | OpenType font | font/otf |
|
||||
| \.png | Portable Network Graphics | image/png |
|
||||
| \.pdf | Adobe Portable Document Format \(PDF\) | application/pdf |
|
||||
| \.php | Hypertext Preprocessor \(Personal Home Page\) | application/php |
|
||||
| \.ppt | Microsoft PowerPoint | application/vnd\.ms\-powerpoint |
|
||||
| \.pptx | Microsoft PowerPoint \(OpenXML\) | application/vnd\.openxmlformats\-officedocument\.presentationml\.presentation |
|
||||
| \.rar | RAR archive | application/vnd\.rar |
|
||||
| \.rtf | Rich Text Format \(RTF\) | application/rtf |
|
||||
| \.sh | Bourne shell script | application/x\-sh |
|
||||
| \.svg | Scalable Vector Graphics \(SVG\) | image/svg\+xml |
|
||||
| \.swf | Small web format \(SWF\) or Adobe Flash document | application/x\-shockwave\-flash |
|
||||
| \.tar | Tape Archive \(TAR\) | application/x\-tar |
|
||||
| \.tif \.tiff | Tagged Image File Format \(TIFF\) | image/tiff |
|
||||
| \.ts | MPEG transport stream | video/mp2t |
|
||||
| \.ttf | TrueType Font | font/ttf |
|
||||
| \.txt | Text, \(generally ASCII or ISO 8859\-n\) | text/plain |
|
||||
| \.vsd | Microsoft Visio | application/vnd\.visio |
|
||||
| \.wav | Waveform Audio Format | audio/wav |
|
||||
| \.weba | WEBM audio | audio/webm |
|
||||
| \.webm | WEBM video | video/webm |
|
||||
| \.webp | WEBP image | image/webp |
|
||||
| \.woff | Web Open Font Format \(WOFF\) | font/woff |
|
||||
| \.woff2 | Web Open Font Format \(WOFF\) | font/woff2 |
|
||||
| \.xhtml | XHTML | application/xhtml\+xml |
|
||||
| \.xls | Microsoft Excel | application/vnd\.ms\-excel |
|
||||
| \.xlsx | Microsoft Excel \(OpenXML\) | application/vnd\.openxmlformats\-officedocument\.spreadsheetml\.sheet |
|
||||
| \.xml | XML | application/xml if not readable from casual users \(RFC 3023, section 3\) text/xml if readable from casual users \(RFC 3023, section 3\) |
|
||||
| \.xul | XUL | application/vnd\.mozilla\.xul\+xml |
|
||||
| \.zip | ZIP archive | application/zip |
|
||||
| \.3gp | 3GPP audio/video container | video/3gpp audio/3gpp if it doesn't contain video |
|
||||
| \.3g2 | 3GPP2 audio/video container | video/3gpp2 audio/3gpp2 if it doesn't contain video |
|
||||
| \.7z | 7\-zip archive | application/x\-7z\-compressed |
|
||||
| \.markdown \.md | Markdown File | text/markdown |
|
||||
| Extension | Kind of document | MIME Type \(Content Type\) |
|
||||
|-----------------|--------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| \.aac | AAC audio | audio/aac |
|
||||
| \.abw | AbiWord document | application/x\-abiword |
|
||||
| \.arc | Archive document \(multiple files embedded\) | application/x\-freearc |
|
||||
| \.avi | AVI: Audio Video Interleave | video/x\-msvideo |
|
||||
| \.azw | Amazon Kindle eBook format | application/vnd\.amazon\.ebook |
|
||||
| \.bin | Any kind of binary data | application/octet\-stream |
|
||||
| \.bmp | Windows OS/2 Bitmap Graphics | image/bmp |
|
||||
| \.bz | BZip archive | application/x\-bzip |
|
||||
| \.bz2 | BZip2 archive | application/x\-bzip2 |
|
||||
| \.csh | C\-Shell script | application/x\-csh |
|
||||
| \.css | Cascading Style Sheets \(CSS\) | text/css |
|
||||
| \.csv | Comma\-separated values \(CSV\) | text/csv |
|
||||
| \.doc | Microsoft Word | application/msword |
|
||||
| \.docx | Microsoft Word \(OpenXML\) | application/vnd\.openxmlformats\-officedocument\.wordprocessingml\.document |
|
||||
| \.eot | MS Embedded OpenType fonts | application/vnd\.ms\-fontobject |
|
||||
| \.epub | Electronic publication \(EPUB\) | application/epub\+zip |
|
||||
| \.gz | GZip Compressed Archive | application/gzip |
|
||||
| \.gif | Graphics Interchange Format \(GIF\) | image/gif |
|
||||
| \.htm \.html | HyperText Markup Language \(HTML\) | text/html |
|
||||
| \.ico | Icon format | image/vnd\.microsoft\.icon |
|
||||
| \.ics | iCalendar format | text/calendar |
|
||||
| \.jar | Java Archive \(JAR\) | application/java\-archive |
|
||||
| \.jpeg \.jpg | JPEG images | image/jpeg |
|
||||
| \.js | JavaScript | text/javascript |
|
||||
| \.json | JSON format | application/json |
|
||||
| \.jsonld | JSON\-LD format | application/ld\+json |
|
||||
| \.mid \.midi | Musical Instrument Digital Interface \(MIDI\) | audio/midi audio/x\-midi |
|
||||
| \.mjs | JavaScript module | text/javascript |
|
||||
| \.mp3 | MP3 audio | audio/mpeg |
|
||||
| \.mpeg | MPEG Video | video/mpeg |
|
||||
| \.mpkg | Apple Installer Package | application/vnd\.apple\.installer\+xml |
|
||||
| \.odp | OpenDocument presentation document | application/vnd\.oasis\.opendocument\.presentation |
|
||||
| \.ods | OpenDocument spreadsheet document | application/vnd\.oasis\.opendocument\.spreadsheet |
|
||||
| \.odt | OpenDocument text document | application/vnd\.oasis\.opendocument\.text |
|
||||
| \.oga | OGG audio | audio/ogg |
|
||||
| \.ogv | OGG video | video/ogg |
|
||||
| \.ogx | OGG | application/ogg |
|
||||
| \.opus | Opus audio | audio/opus |
|
||||
| \.otf | OpenType font | font/otf |
|
||||
| \.png | Portable Network Graphics | image/png |
|
||||
| \.pdf | Adobe Portable Document Format \(PDF\) | application/pdf |
|
||||
| \.php | Hypertext Preprocessor \(Personal Home Page\) | application/php |
|
||||
| \.ppt | Microsoft PowerPoint | application/vnd\.ms\-powerpoint |
|
||||
| \.pptx | Microsoft PowerPoint \(OpenXML\) | application/vnd\.openxmlformats\-officedocument\.presentationml\.presentation |
|
||||
| \.rar | RAR archive | application/vnd\.rar |
|
||||
| \.rtf | Rich Text Format \(RTF\) | application/rtf |
|
||||
| \.sh | Bourne shell script | application/x\-sh |
|
||||
| \.svg | Scalable Vector Graphics \(SVG\) | image/svg\+xml |
|
||||
| \.swf | Small web format \(SWF\) or Adobe Flash document | application/x\-shockwave\-flash |
|
||||
| \.tar | Tape Archive \(TAR\) | application/x\-tar |
|
||||
| \.tif \.tiff | Tagged Image File Format \(TIFF\) | image/tiff |
|
||||
| \.ts | MPEG transport stream | video/mp2t |
|
||||
| \.ttf | TrueType Font | font/ttf |
|
||||
| \.txt | Text, \(generally ASCII or ISO 8859\-n\) | text/plain |
|
||||
| \.vsd | Microsoft Visio | application/vnd\.visio |
|
||||
| \.wav | Waveform Audio Format | audio/wav |
|
||||
| \.weba | WEBM audio | audio/webm |
|
||||
| \.webm | WEBM video | video/webm |
|
||||
| \.webp | WEBP image | image/webp |
|
||||
| \.woff | Web Open Font Format \(WOFF\) | font/woff |
|
||||
| \.woff2 | Web Open Font Format \(WOFF\) | font/woff2 |
|
||||
| \.xhtml | XHTML | application/xhtml\+xml |
|
||||
| \.xls | Microsoft Excel | application/vnd\.ms\-excel |
|
||||
| \.xlsx | Microsoft Excel \(OpenXML\) | application/vnd\.openxmlformats\-officedocument\.spreadsheetml\.sheet |
|
||||
| \.xml | XML | application/xml if not readable from casual users \(RFC 3023, section 3\) text/xml if readable from casual users \(RFC 3023, section 3\) |
|
||||
| \.xul | XUL | application/vnd\.mozilla\.xul\+xml |
|
||||
| \.zip | ZIP archive | application/zip |
|
||||
| \.3gp | 3GPP audio/video container | video/3gpp audio/3gpp if it doesn't contain video |
|
||||
| \.3g2 | 3GPP2 audio/video container | video/3gpp2 audio/3gpp2 if it doesn't contain video |
|
||||
| \.7z | 7\-zip archive | application/x\-7z\-compressed |
|
||||
| \.markdown \.md | Markdown File | text/markdown |
|
||||
{.show-header}
|
||||
|
||||
|
||||
|
||||
+90
-90
@@ -18,16 +18,16 @@ Getting started {.cols-3}
|
||||
---------------
|
||||
|
||||
### Usage {.col-span-2}
|
||||
| Option | Example | Description |
|
||||
|--------|-----------------------------|----------------------------------------------------|
|
||||
| `-p` | mitmproxy -p 8001 | Start proxy on port 8001 |
|
||||
| `-m` | mitmproxy -p 8001 -m reverse:http://127.0.0.1:4000 | Reverse proxy on port 8001 to port 4000 |
|
||||
| `-w` | mitmproxy -p 8001 -w traffic.mitm | Stream flows to file as they arrive |
|
||||
| `-r` | mitmproxy -r traffic.mitm | Read flows from file |
|
||||
| `-C` | mitmproxy -C traffic.mitm | Replay client requests from a saved file |
|
||||
| `-S` | mitmproxy -S traffic.mitm | Replay server responses from a saved file |
|
||||
| `-s` | mitmproxy -s myScript.py | Execute a script |
|
||||
| `-h` | mitmproxy -h | mitmproxy quick help |
|
||||
| Option | Example | Description |
|
||||
|--------|----------------------------------------------------|-------------------------------------------|
|
||||
| `-p` | mitmproxy -p 8001 | Start proxy on port 8001 |
|
||||
| `-m` | mitmproxy -p 8001 -m reverse:http://127.0.0.1:4000 | Reverse proxy on port 8001 to port 4000 |
|
||||
| `-w` | mitmproxy -p 8001 -w traffic.mitm | Stream flows to file as they arrive |
|
||||
| `-r` | mitmproxy -r traffic.mitm | Read flows from file |
|
||||
| `-C` | mitmproxy -C traffic.mitm | Replay client requests from a saved file |
|
||||
| `-S` | mitmproxy -S traffic.mitm | Replay server responses from a saved file |
|
||||
| `-s` | mitmproxy -s myScript.py | Execute a script |
|
||||
| `-h` | mitmproxy -h | mitmproxy quick help |
|
||||
|
||||
|
||||
### Movement
|
||||
@@ -42,46 +42,46 @@ h ◀ ─── + ─── ▶ l ││ page
|
||||
```
|
||||
---
|
||||
|
||||
| - | - |
|
||||
|--------------------|-----------------------|
|
||||
| `h`, `j`, `k` ,`l` | Left, Down, Up, Right |
|
||||
| `Ctrl` `b` | Page up |
|
||||
| `Space` / `Ctrl` `f` | Page down |
|
||||
| `g` / `G` | Go to beginning / end |
|
||||
| `Arrows` | Up, Down, Left, Right |
|
||||
| - | - |
|
||||
|----------------------|-----------------------|
|
||||
| `h`, `j`, `k` ,`l` | Left, Down, Up, Right |
|
||||
| `Ctrl` `b` | Page up |
|
||||
| `Space` / `Ctrl` `f` | Page down |
|
||||
| `g` / `G` | Go to beginning / end |
|
||||
| `Arrows` | Up, Down, Left, Right |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
|
||||
|
||||
### Common Keybindings
|
||||
| - | - |
|
||||
|---------|-----------------------|
|
||||
| `q` | Back / Exit |
|
||||
| `z` | Clear flow list |
|
||||
| `:` | Command prompt |
|
||||
| `E` | View event log |
|
||||
| `O` | View options |
|
||||
| `r` | Replay this flow |
|
||||
| `Tab` | Next |
|
||||
| `Enter` | Select |
|
||||
| - | - |
|
||||
|---------|------------------|
|
||||
| `q` | Back / Exit |
|
||||
| `z` | Clear flow list |
|
||||
| `:` | Command prompt |
|
||||
| `E` | View event log |
|
||||
| `O` | View options |
|
||||
| `r` | Replay this flow |
|
||||
| `Tab` | Next |
|
||||
| `Enter` | Select |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
|
||||
### Global Keybindings
|
||||
| - | - |
|
||||
|--------------|---------------------------|
|
||||
| `-` | Cycle to next layout |
|
||||
| `?` | View help |
|
||||
| `B` | Start an attached browser |
|
||||
| `C` | View commands |
|
||||
| `I` | Toggle intercept |
|
||||
| `K` | View key bindings |
|
||||
| `P` | View flow details |
|
||||
| `Q` | Exit immediately |
|
||||
| `W` | Stream to file |
|
||||
| `i` | Set intercept |
|
||||
| - | - |
|
||||
|----------------|---------------------------|
|
||||
| `-` | Cycle to next layout |
|
||||
| `?` | View help |
|
||||
| `B` | Start an attached browser |
|
||||
| `C` | View commands |
|
||||
| `I` | Toggle intercept |
|
||||
| `K` | View key bindings |
|
||||
| `P` | View flow details |
|
||||
| `Q` | Exit immediately |
|
||||
| `W` | Stream to file |
|
||||
| `i` | Set intercept |
|
||||
| `Ctrl` `right` | Focus next layout pane |
|
||||
| `Shift` `tab` | Focus next layout pane |
|
||||
{.shortcuts}
|
||||
@@ -92,30 +92,30 @@ h ◀ ─── + ─── ▶ l ││ page
|
||||
|
||||
|
||||
### Flow (View)
|
||||
| - | - |
|
||||
|----------|------------------------------|
|
||||
| `A` | Resume all intercepted flows |
|
||||
| `D` | Duplicate flow |
|
||||
| `F` | Set focus follow |
|
||||
| `L` | Load flows from file |
|
||||
| `M` | Toggle viewing marked flows |
|
||||
| `S` | Start server replay |
|
||||
| `U` | Un-set all marks |
|
||||
| `V` | Revert changes to this flow |
|
||||
| `X` | Kill this flow |
|
||||
| `Z` | Purge all flows not showing |
|
||||
| `a` | Resume this intercepted flow |
|
||||
| `b` | Save response body to file |
|
||||
| `d` | Delete flow from view |
|
||||
| `e` | Export this flow to file |
|
||||
| `f` | Set view filter |
|
||||
| `m` | Toggle mark on this flow |
|
||||
| `n` | Create a new flow |
|
||||
| `o` | Set flow list order |
|
||||
| `r` | Replay this flow |
|
||||
| `v` | Reverse flow list order |
|
||||
| `w` | Save listed flows to file |
|
||||
| `|` | Run a script on this flow |
|
||||
| - | - |
|
||||
|------------|------------------------------|
|
||||
| `A` | Resume all intercepted flows |
|
||||
| `D` | Duplicate flow |
|
||||
| `F` | Set focus follow |
|
||||
| `L` | Load flows from file |
|
||||
| `M` | Toggle viewing marked flows |
|
||||
| `S` | Start server replay |
|
||||
| `U` | Un-set all marks |
|
||||
| `V` | Revert changes to this flow |
|
||||
| `X` | Kill this flow |
|
||||
| `Z` | Purge all flows not showing |
|
||||
| `a` | Resume this intercepted flow |
|
||||
| `b` | Save response body to file |
|
||||
| `d` | Delete flow from view |
|
||||
| `e` | Export this flow to file |
|
||||
| `f` | Set view filter |
|
||||
| `m` | Toggle mark on this flow |
|
||||
| `n` | Create a new flow |
|
||||
| `o` | Set flow list order |
|
||||
| `r` | Replay this flow |
|
||||
| `v` | Reverse flow list order |
|
||||
| `w` | Save listed flows to file |
|
||||
| `|` | Run a script on this flow |
|
||||
| `Ctrl` `l` | Send cuts to clipboard |
|
||||
|
||||
{.shortcuts}
|
||||
@@ -127,9 +127,9 @@ Mitmproxy Filter {.cols-3}
|
||||
---------------
|
||||
|
||||
### Filter
|
||||
| - | - |
|
||||
|----------|------------------------------|
|
||||
| `f` | Set view filter _(on flow view page)_ |
|
||||
| - | - |
|
||||
|-----|---------------------------------------|
|
||||
| `f` | Set view filter _(on flow view page)_ |
|
||||
{.shortcuts}
|
||||
|
||||
---
|
||||
@@ -142,52 +142,52 @@ The regex are Python-style, it can be specified as quoted strings
|
||||
|
||||
### Operators
|
||||
|
||||
| - | - |
|
||||
|--------------|------------------------------------------------------------|
|
||||
| `!` | unary not |
|
||||
| `&` | and |
|
||||
| `|` | or |
|
||||
| `(...)` | grouping |
|
||||
| - | - |
|
||||
|---------|-----------|
|
||||
| `!` | unary not |
|
||||
| `&` | and |
|
||||
| `|` | or |
|
||||
| `(...)` | grouping |
|
||||
|
||||
|
||||
### Expressions {.row-span-2}
|
||||
|
||||
| - | - |
|
||||
|--------------|------------------------------------------------------------|
|
||||
| `~a` | Match asset in response: CSS, Javascript, Flash, images. |
|
||||
| - | - |
|
||||
|----------------|------------------------------------------------------------|
|
||||
| `~a` | Match asset in response: CSS, Javascript, Flash, images. |
|
||||
| `~b` `regex` | Body |
|
||||
| `~bq` `regex` | Request body |
|
||||
| `~bs` `regex` | Response body |
|
||||
| `~c` `int` | HTTP response code |
|
||||
| `~d` `regex` | Domain |
|
||||
| `~dst` `regex` | Match destination address |
|
||||
| `~e` | Match error |
|
||||
| `~e` | Match error |
|
||||
| `~h` `regex` | Header |
|
||||
| `~hq` `regex` | Request header |
|
||||
| `~hs` `regex` | Response header |
|
||||
| `~http` | Match HTTP flows |
|
||||
| `~http` | Match HTTP flows |
|
||||
| `~m` `regex` | Method |
|
||||
| `~marked` | Match marked flows |
|
||||
| `~q` | Match request with no response |
|
||||
| `~s` | Match response |
|
||||
| `~marked` | Match marked flows |
|
||||
| `~q` | Match request with no response |
|
||||
| `~s` | Match response |
|
||||
| `~src` `regex` | Match source address |
|
||||
| `~t` `regex` | Content-type header |
|
||||
| `~tcp` | Match TCP flows |
|
||||
| `~tcp` | Match TCP flows |
|
||||
| `~tq` `regex` | Request Content-Type header |
|
||||
| `~ts` `regex` | Response Content-Type header |
|
||||
| `~u` `regex` | URL |
|
||||
| `~websocket` | Match WebSocket flows (and HTTP-WebSocket handshake flows) |
|
||||
| `~websocket` | Match WebSocket flows (and HTTP-WebSocket handshake flows) |
|
||||
|
||||
### Flow selectors
|
||||
Expressions
|
||||
| - | - |
|
||||
|--------------|----------------------------|
|
||||
| `@all ` | All flows |
|
||||
| `@focus ` | The currently focused flow |
|
||||
| `@shown ` | All flows currently shown |
|
||||
| `@hidden ` | All flows currently hidden |
|
||||
| `@marked ` | All marked flows |
|
||||
| `@unmarked` | All unmarked flows |
|
||||
| - | - |
|
||||
|-------------|----------------------------|
|
||||
| `@all ` | All flows |
|
||||
| `@focus ` | The currently focused flow |
|
||||
| `@shown ` | All flows currently shown |
|
||||
| `@hidden ` | All flows currently hidden |
|
||||
| `@marked ` | All marked flows |
|
||||
| `@unmarked` | All unmarked flows |
|
||||
|
||||
mitmproxy has a set of convenient flow selectors that operate on the current view
|
||||
|
||||
|
||||
@@ -35,34 +35,34 @@ mysql -h <host> -u <user> -p [db_name]
|
||||
|
||||
#### Database
|
||||
|
||||
| - | - |
|
||||
|------------------------|-------------------------|
|
||||
| `create database` db `;` | Create database |
|
||||
| `show databases;` | List databases |
|
||||
| `use` db`;` | Switch to db |
|
||||
| `drop database` db`;` | Delete db |
|
||||
| - | - |
|
||||
|--------------------------|-----------------|
|
||||
| `create database` db `;` | Create database |
|
||||
| `show databases;` | List databases |
|
||||
| `use` db`;` | Switch to db |
|
||||
| `drop database` db`;` | Delete db |
|
||||
|
||||
#### Table
|
||||
|
||||
| - | - |
|
||||
|------------------------|-------------------------|
|
||||
| `show tables;` | List tables for current db |
|
||||
| `show fields from` t`;` | List fields for a table |
|
||||
| `desc` t`;` | Show table structure |
|
||||
| `show create table `t`;` | Show create table sql |
|
||||
| `truncate table `t`;` | Remove all data in a table |
|
||||
| `drop table `t`;` | Delete table |
|
||||
| - | - |
|
||||
|--------------------------|----------------------------|
|
||||
| `show tables;` | List tables for current db |
|
||||
| `show fields from` t`;` | List fields for a table |
|
||||
| `desc` t`;` | Show table structure |
|
||||
| `show create table `t`;` | Show create table sql |
|
||||
| `truncate table `t`;` | Remove all data in a table |
|
||||
| `drop table `t`;` | Delete table |
|
||||
#### Proccess
|
||||
|
||||
| - | - |
|
||||
|------------------------|-------------------------|
|
||||
| `show processlist;` | List processes |
|
||||
| `kill` pid`;` | kill process |
|
||||
| - | - |
|
||||
|---------------------|----------------|
|
||||
| `show processlist;` | List processes |
|
||||
| `kill` pid`;` | kill process |
|
||||
#### Other
|
||||
|
||||
| - | - |
|
||||
|------------------------|-------------------------|
|
||||
| `exit` or `\q` | Exit MySQL session |
|
||||
| - | - |
|
||||
|----------------|--------------------|
|
||||
| `exit` or `\q` | Exit MySQL session |
|
||||
|
||||
|
||||
|
||||
@@ -513,14 +513,14 @@ EXECUTE stored_procedure;
|
||||
```
|
||||
#### WHEN
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|----------|--------------------------------|
|
||||
| `BEFORE` | invoke before the event occurs |
|
||||
| `AFTER` | invoke after the event occurs |
|
||||
|
||||
#### EVENT
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|----------|-------------------|
|
||||
| `INSERT` | invoke for INSERT |
|
||||
| `UPDATE` | invoke for UPDATE |
|
||||
@@ -528,7 +528,7 @@ EXECUTE stored_procedure;
|
||||
|
||||
#### TRIGGER_TYPE
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|----------------------|---|
|
||||
| `FOR EACH ROW` | |
|
||||
| `FOR EACH STATEMENT` | |
|
||||
@@ -567,19 +567,19 @@ MySQL Data Types {.cols-3}
|
||||
|
||||
### Strings
|
||||
|
||||
| - | - |
|
||||
|---------------|-------------------------------|
|
||||
| `CHAR` | String (0 - 255) |
|
||||
| `VARCHAR` | String (0 - 255) |
|
||||
| `TINYTEXT` | String (0 - 255) |
|
||||
| `TEXT` | String (0 - 65535) |
|
||||
| `BLOB` | String (0 - 65535) |
|
||||
| `MEDIUMTEXT` | String (0 - 16777215) |
|
||||
| `MEDIUMBLOB` | String (0 - 16777215) |
|
||||
| `LONGTEXT` | String (0 - 4294967295) |
|
||||
| `LONGBLOB` | String (0 - 4294967295) |
|
||||
| `ENUM` | One of preset options |
|
||||
| `SET` | Selection of preset options |
|
||||
| - | - |
|
||||
|--------------|-----------------------------|
|
||||
| `CHAR` | String (0 - 255) |
|
||||
| `VARCHAR` | String (0 - 255) |
|
||||
| `TINYTEXT` | String (0 - 255) |
|
||||
| `TEXT` | String (0 - 65535) |
|
||||
| `BLOB` | String (0 - 65535) |
|
||||
| `MEDIUMTEXT` | String (0 - 16777215) |
|
||||
| `MEDIUMBLOB` | String (0 - 16777215) |
|
||||
| `LONGTEXT` | String (0 - 4294967295) |
|
||||
| `LONGBLOB` | String (0 - 4294967295) |
|
||||
| `ENUM` | One of preset options |
|
||||
| `SET` | Selection of preset options |
|
||||
|
||||
|
||||
### Date & time
|
||||
@@ -594,7 +594,7 @@ MySQL Data Types {.cols-3}
|
||||
|
||||
### Numeric
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|---------------|---------------------------------------------------------------|
|
||||
| `TINYINT x` | Integer (-128 to 127) |
|
||||
| `SMALLINT x` | Integer (-32768 to 32767) |
|
||||
|
||||
@@ -34,19 +34,19 @@ $ nc -lp port [host] [port]
|
||||
|
||||
### Option examples {.col-span-3 .row-span-2}
|
||||
|
||||
| Option | Description | Example |
|
||||
|--------|-----------------------------|----------------------------------------------------|
|
||||
| `-h` | nc -h | Help |
|
||||
| `-z` | nc -z 192.168.1.9 1-100 | Port scan for a host or IP address |
|
||||
| `-v` | nc -zv 192.168.1.9 1-100 | Provide verbose output |
|
||||
| `-n` | nc -zn 192.168.1.9 1-100 | Fast scan by disabling DNS resolution |
|
||||
| `-l` | nc -lp 8000 | TCP Listen mode _(for inbound connects)_ |
|
||||
| `-w` | nc -w 180 192.168.1.9 8000 | Define timeout value |
|
||||
| `-k` | nc -kl 8000 | Continue listening after disconnection |
|
||||
| `-u` | nc -u 192.168.1.9 8000 | Use UDP instead of TCP |
|
||||
| `-q` | nc -q 1 192.168.1.9 8000 | Client stay up after EOF |
|
||||
| `-4` | nc -4 -l 8000 | IPv4 only |
|
||||
| `-6` | nc -6 -l 8000 | IPv6 only |
|
||||
| Option | Description | Example |
|
||||
|--------|----------------------------|------------------------------------------|
|
||||
| `-h` | nc -h | Help |
|
||||
| `-z` | nc -z 192.168.1.9 1-100 | Port scan for a host or IP address |
|
||||
| `-v` | nc -zv 192.168.1.9 1-100 | Provide verbose output |
|
||||
| `-n` | nc -zn 192.168.1.9 1-100 | Fast scan by disabling DNS resolution |
|
||||
| `-l` | nc -lp 8000 | TCP Listen mode _(for inbound connects)_ |
|
||||
| `-w` | nc -w 180 192.168.1.9 8000 | Define timeout value |
|
||||
| `-k` | nc -kl 8000 | Continue listening after disconnection |
|
||||
| `-u` | nc -u 192.168.1.9 8000 | Use UDP instead of TCP |
|
||||
| `-q` | nc -q 1 192.168.1.9 8000 | Client stay up after EOF |
|
||||
| `-4` | nc -4 -l 8000 | IPv4 only |
|
||||
| `-6` | nc -6 -l 8000 | IPv6 only |
|
||||
|
||||
|
||||
### Chat client-server {.col-span-2}
|
||||
|
||||
@@ -27,9 +27,9 @@ Neo4j is a Graph Database consisting of nodes connected together by relationship
|
||||
|
||||
### Graph Database Concepts
|
||||
|
||||
| | |
|
||||
| -- | -- |
|
||||
| **Nodes** | Nodes are commonly used to represent _entities_ or _things_ in your data. For example, a **Person** or **Movie** |
|
||||
| | |
|
||||
|-----------|-------------------------------------------------------------------------------------------------------------------|
|
||||
| **Nodes** | Nodes are commonly used to represent _entities_ or _things_ in your data. For example, a **Person** or **Movie** |
|
||||
| **Relationships** | Relationships are used to connect two nodes together and organise the data into structure. For example, a Person **acted in** a movie. A relationship has a _type_ and _direction_, although the direction can be ignored at query time.
|
||||
| **Labels** | Labels are used to group nodes into categories. For example, a person may have `Person` and `Actor` labels.
|
||||
| **Relationship Type** | Each relationship has a type. Relationships allow you to explore smaller sections of a graph. |
|
||||
@@ -511,16 +511,16 @@ Returns the line number that LOAD CSV is currently processing, returns null if c
|
||||
|
||||
### Operators
|
||||
|
||||
| | |
|
||||
| -- | -- |
|
||||
| **General** | DISTINCT, ., [] |
|
||||
| **Mathematical** | +, -, *, /, %, ^ |
|
||||
| **Comparison** | =, <>, <, >, <=, >=, IS NULL, IS NOT NULL |
|
||||
| **Boolean** | AND, OR, XOR, NOT |
|
||||
| **String** | + |
|
||||
| **List** | +, IN, [x], [x .. y] |
|
||||
| **Regular Expression** | =~ |
|
||||
| **String matching** | STARTS WITH, ENDS WITH, CONTAINS |
|
||||
| | |
|
||||
|------------------------|-------------------------------------------|
|
||||
| **General** | DISTINCT, ., [] |
|
||||
| **Mathematical** | +, -, *, /, %, ^ |
|
||||
| **Comparison** | =, <>, <, >, <=, >=, IS NULL, IS NOT NULL |
|
||||
| **Boolean** | AND, OR, XOR, NOT |
|
||||
| **String** | + |
|
||||
| **List** | +, IN, [x], [x .. y] |
|
||||
| **Regular Expression** | =~ |
|
||||
| **String matching** | STARTS WITH, ENDS WITH, CONTAINS |
|
||||
|
||||
|
||||
### null
|
||||
|
||||
+23
-23
@@ -31,52 +31,52 @@ $ netstat -h
|
||||
|
||||
|
||||
### Listening
|
||||
| Option | Example |
|
||||
|-----------------|------------------------------------------------|
|
||||
| Option | Example |
|
||||
|------------------|----------------------|
|
||||
| `netstat -ltunp` | All Listening ports |
|
||||
| `netstat -ltn` | Listening TCP ports |
|
||||
| `netstat -lun` | Listening UDP ports |
|
||||
| `netstat -lx` | Listening Unix ports |
|
||||
| `netstat -ltn` | Listening TCP ports |
|
||||
| `netstat -lun` | Listening UDP ports |
|
||||
| `netstat -lx` | Listening Unix ports |
|
||||
|
||||
|
||||
|
||||
|
||||
### Connections
|
||||
|
||||
| Option | Example |
|
||||
|-----------------|------------------------------------------------|
|
||||
| `netstat -a` | All connections |
|
||||
| `netstat -at` | All TCP connections |
|
||||
| `netstat -au` | All UDP connections |
|
||||
| Option | Example |
|
||||
|---------------|---------------------|
|
||||
| `netstat -a` | All connections |
|
||||
| `netstat -at` | All TCP connections |
|
||||
| `netstat -au` | All UDP connections |
|
||||
|
||||
|
||||
|
||||
|
||||
### Statistics
|
||||
|
||||
| Option | Example |
|
||||
|-----------------|------------------------------------------------|
|
||||
| `netstat -s` | Display statistics |
|
||||
| `netstat -st` | Display TCP statistics |
|
||||
| `netstat -su` | Display UDP statistics |
|
||||
| Option | Example |
|
||||
|---------------|------------------------|
|
||||
| `netstat -s` | Display statistics |
|
||||
| `netstat -st` | Display TCP statistics |
|
||||
| `netstat -su` | Display UDP statistics |
|
||||
|
||||
|
||||
|
||||
|
||||
### Networks
|
||||
|
||||
| Option | Example |
|
||||
|-----------------|------------------------------------------------|
|
||||
| `netstat -i` | Show network interfaces |
|
||||
| `netstat -ie` | Show network interfaces extended info |
|
||||
| Option | Example |
|
||||
|---------------|---------------------------------------|
|
||||
| `netstat -i` | Show network interfaces |
|
||||
| `netstat -ie` | Show network interfaces extended info |
|
||||
|
||||
|
||||
|
||||
### Routing
|
||||
|
||||
| Option | Example |
|
||||
|-----------------|------------------------------------------------|
|
||||
| `netstat -r` | Show routing table |
|
||||
| `netstat -rn` | Show routing table, don't resolve hosts |
|
||||
| Option | Example |
|
||||
|---------------|-----------------------------------------|
|
||||
| `netstat -r` | Show routing table |
|
||||
| `netstat -rn` | Show routing table, don't resolve hosts |
|
||||
|
||||
|
||||
@@ -27,23 +27,23 @@ import numpy as np
|
||||
### Importing/exporting
|
||||
|
||||
|
||||
| - | - |
|
||||
|-----|-----|
|
||||
| `np.loadtxt('file.txt')` | From a text file |
|
||||
| `np.genfromtxt('file.csv',delimiter=',')` | From a CSV file |
|
||||
| - | - |
|
||||
|--------------------------------------------|-----------------------|
|
||||
| `np.loadtxt('file.txt')` | From a text file |
|
||||
| `np.genfromtxt('file.csv',delimiter=',')` | From a CSV file |
|
||||
| `np.savetxt('file.txt',arr,delimiter=' ')` | Writes to a text file |
|
||||
| `np.savetxt('file.csv',arr,delimiter=',')` | Writes to a CSV file |
|
||||
| `np.savetxt('file.csv',arr,delimiter=',')` | Writes to a CSV file |
|
||||
|
||||
|
||||
### Creating Arrays {.row-span-2}
|
||||
|
||||
|
||||
| - | - |
|
||||
|-----|-----|
|
||||
| `np.array([1,2,3])` | One dimensional array |
|
||||
| `np.array([(1,2,3),(4,5,6)])` | Two dimensional array |
|
||||
| `np.zeros(3)` | 1D array of length 3 all values 0 |
|
||||
| `np.ones((3,4))` | 3x4 array with all values 1 |
|
||||
| - | - |
|
||||
|-------------------------------|-----------------------------------|
|
||||
| `np.array([1,2,3])` | One dimensional array |
|
||||
| `np.array([(1,2,3),(4,5,6)])` | Two dimensional array |
|
||||
| `np.zeros(3)` | 1D array of length 3 all values 0 |
|
||||
| `np.ones((3,4))` | 3x4 array with all values 1 |
|
||||
| `np.eye(5)` | 5x5 array of 0 with 1 on diagonal (Identity matrix)
|
||||
| `np.linspace(0,100,6)` | Array of 6 evenly divided values from 0 to 100 |
|
||||
| `np.arange(0,10,3)` | Array of values from 0 to less than 10 with step 3 (eg [0,3,6,9])
|
||||
@@ -56,8 +56,8 @@ import numpy as np
|
||||
### Inspecting Properties
|
||||
|
||||
|
||||
| - | - |
|
||||
|-----|-----|
|
||||
| - | - |
|
||||
|------------|-----------------------------------|
|
||||
| `arr.size` | Returns number of elements in arr |
|
||||
| `arr.shape` | Returns dimensions of arr (rows,columns)
|
||||
| `arr.dtype` | Returns type of elements in arr |
|
||||
@@ -69,13 +69,13 @@ import numpy as np
|
||||
### Copying/sorting/reshaping
|
||||
|
||||
|
||||
| - | - |
|
||||
|-----|-----|
|
||||
| `np.copy(arr)` | Copies arr to new memory |
|
||||
| `arr.view(dtype)` | Creates view of arr elements with type dtype |
|
||||
| `arr.sort()` | Sorts arr |
|
||||
| `arr.sort(axis=0)` | Sorts specific axis of arr |
|
||||
| `two_d_arr.flatten()` | Flattens 2D array two_d_arr to 1D |
|
||||
| - | - |
|
||||
|-----------------------|----------------------------------------------|
|
||||
| `np.copy(arr)` | Copies arr to new memory |
|
||||
| `arr.view(dtype)` | Creates view of arr elements with type dtype |
|
||||
| `arr.sort()` | Sorts arr |
|
||||
| `arr.sort(axis=0)` | Sorts specific axis of arr |
|
||||
| `two_d_arr.flatten()` | Flattens 2D array two_d_arr to 1D |
|
||||
| `arr.T` | Transposes arr (rows become columns and vice versa)
|
||||
| `arr.reshape(3,4)` | Reshapes arr to 3 rows, 4 columns without changing data |
|
||||
| `arr.resize((5,6))` | Changes arr shape to 5x6 and fills new values with 0 |
|
||||
@@ -84,30 +84,30 @@ import numpy as np
|
||||
### Adding/removing Elements
|
||||
|
||||
|
||||
| - | - |
|
||||
|-----|-----|
|
||||
| `np.append(arr,values)` | Appends values to end of arr |
|
||||
| - | - |
|
||||
|---------------------------|----------------------------------------|
|
||||
| `np.append(arr,values)` | Appends values to end of arr |
|
||||
| `np.insert(arr,2,values)` | Inserts values into arr before index 2 |
|
||||
| `np.delete(arr,3,axis=0)` | Deletes row on index 3 of arr |
|
||||
| `np.delete(arr,4,axis=1)` | Deletes column on index 4 of arr |
|
||||
| `np.delete(arr,3,axis=0)` | Deletes row on index 3 of arr |
|
||||
| `np.delete(arr,4,axis=1)` | Deletes column on index 4 of arr |
|
||||
|
||||
|
||||
### Combining/splitting
|
||||
|
||||
|
||||
| - | - |
|
||||
|-----|-----|
|
||||
| `np.concatenate((arr1,arr2),axis=0)` | Adds arr2 as rows to the end of arr1 |
|
||||
| `np.concatenate((arr1,arr2),axis=1)` | Adds arr2 as columns to end of arr1 |
|
||||
| `np.split(arr,3)` | Splits arr into 3 sub-arrays |
|
||||
| `np.hsplit(arr,5)` | Splits arr horizontally on the 5th index |
|
||||
| - | - |
|
||||
|--------------------------------------|------------------------------------------|
|
||||
| `np.concatenate((arr1,arr2),axis=0)` | Adds arr2 as rows to the end of arr1 |
|
||||
| `np.concatenate((arr1,arr2),axis=1)` | Adds arr2 as columns to end of arr1 |
|
||||
| `np.split(arr,3)` | Splits arr into 3 sub-arrays |
|
||||
| `np.hsplit(arr,5)` | Splits arr horizontally on the 5th index |
|
||||
|
||||
|
||||
### Indexing/slicing/subsetting
|
||||
|
||||
|
||||
| - | - |
|
||||
|-----|-----|
|
||||
| - | - |
|
||||
|----------|--------------------------------|
|
||||
| `arr[5]` | Returns the element at index 5 |
|
||||
| `arr[2,5]` | Returns the 2D array element on index [2][5]
|
||||
| `arr[1]=4` | Assigns array element on index 1 the value 4 |
|
||||
@@ -126,31 +126,31 @@ import numpy as np
|
||||
### Vector Math
|
||||
|
||||
|
||||
| - | - |
|
||||
|-----|-----|
|
||||
| `np.add(arr1,arr2)` | Elementwise add arr2 to arr1 |
|
||||
| `np.subtract(arr1,arr2)` | Elementwise subtract arr2 from arr1 |
|
||||
| `np.multiply(arr1,arr2)` | Elementwise multiply arr1 by arr2 |
|
||||
| `np.divide(arr1,arr2)` | Elementwise divide arr1 by arr2 |
|
||||
| `np.power(arr1,arr2)` | Elementwise raise arr1 raised to the power of arr2 |
|
||||
| - | - |
|
||||
|-----------------------------|-------------------------------------------------------------|
|
||||
| `np.add(arr1,arr2)` | Elementwise add arr2 to arr1 |
|
||||
| `np.subtract(arr1,arr2)` | Elementwise subtract arr2 from arr1 |
|
||||
| `np.multiply(arr1,arr2)` | Elementwise multiply arr1 by arr2 |
|
||||
| `np.divide(arr1,arr2)` | Elementwise divide arr1 by arr2 |
|
||||
| `np.power(arr1,arr2)` | Elementwise raise arr1 raised to the power of arr2 |
|
||||
| `np.array_equal(arr1,arr2)` | Returns True if the arrays have the same elements and shape |
|
||||
| `np.sqrt(arr)` | Square root of each element in the array |
|
||||
| `np.sin(arr)` | Sine of each element in the array |
|
||||
| `np.log(arr)` | Natural log of each element in the array |
|
||||
| `np.abs(arr)` | Absolute value of each element in the array |
|
||||
| `np.ceil(arr)` | Rounds up to the nearest int |
|
||||
| `np.floor(arr)` | Rounds down to the nearest int |
|
||||
| `np.round(arr)` | Rounds to the nearest int |
|
||||
| `np.sqrt(arr)` | Square root of each element in the array |
|
||||
| `np.sin(arr)` | Sine of each element in the array |
|
||||
| `np.log(arr)` | Natural log of each element in the array |
|
||||
| `np.abs(arr)` | Absolute value of each element in the array |
|
||||
| `np.ceil(arr)` | Rounds up to the nearest int |
|
||||
| `np.floor(arr)` | Rounds down to the nearest int |
|
||||
| `np.round(arr)` | Rounds to the nearest int |
|
||||
|
||||
|
||||
### Scalar Math
|
||||
|
||||
|
||||
| - | - |
|
||||
|-----|-----|
|
||||
| `np.add(arr,1)` | Add 1 to each array element |
|
||||
| - | - |
|
||||
|----------------------|------------------------------------|
|
||||
| `np.add(arr,1)` | Add 1 to each array element |
|
||||
| `np.subtract(arr,2)` | Subtract 2 from each array element |
|
||||
| `np.multiply(arr,3)` | Multiply each array element by 3 |
|
||||
| `np.multiply(arr,3)` | Multiply each array element by 3 |
|
||||
| `np.divide(arr,4)` | Divide each array element by 4 (returns np.nan for division by zero)
|
||||
| `np.power(arr,5)` | Raise each array element to the 5th power |
|
||||
|
||||
@@ -158,12 +158,12 @@ import numpy as np
|
||||
### Statistics
|
||||
|
||||
|
||||
| - | - |
|
||||
|-----|-----|
|
||||
| `np.mean(arr,axis=0)` | Returns mean along specific axis |
|
||||
| `arr.sum()` | Returns sum of arr |
|
||||
| `arr.min()` | Returns minimum value of arr |
|
||||
| `arr.max(axis=0)` | Returns maximum value of specific axis |
|
||||
| `np.var(arr)` | Returns the variance of array |
|
||||
| `np.std(arr,axis=1)` | Returns the standard deviation of specific axis |
|
||||
| `arr.corrcoef()` | Returns correlation coefficient of array |
|
||||
| - | - |
|
||||
|-----------------------|-------------------------------------------------|
|
||||
| `np.mean(arr,axis=0)` | Returns mean along specific axis |
|
||||
| `arr.sum()` | Returns sum of arr |
|
||||
| `arr.min()` | Returns minimum value of arr |
|
||||
| `arr.max(axis=0)` | Returns maximum value of specific axis |
|
||||
| `np.var(arr)` | Returns the variance of array |
|
||||
| `np.std(arr,axis=1)` | Returns the standard deviation of specific axis |
|
||||
| `arr.corrcoef()` | Returns correlation coefficient of array |
|
||||
@@ -477,8 +477,8 @@ PHP Operators {.cols-4}
|
||||
|
||||
|
||||
### Arithmetic
|
||||
| - | - |
|
||||
|----|----------------|
|
||||
| - | - |
|
||||
|------|----------------|
|
||||
| `+` | Addition |
|
||||
| `-` | Subtraction |
|
||||
| `*` | Multiplication |
|
||||
@@ -487,8 +487,8 @@ PHP Operators {.cols-4}
|
||||
| `**` | Exponentiation |
|
||||
|
||||
### Assignment
|
||||
| - | - |
|
||||
|--------|-------------------|
|
||||
| - | - |
|
||||
|----------|---------------------|
|
||||
| `a += b` | Same as `a = a + b` |
|
||||
| `a -= b` | Same as `a = a – b` |
|
||||
| `a *= b` | Same as `a = a * b` |
|
||||
@@ -497,8 +497,8 @@ PHP Operators {.cols-4}
|
||||
|
||||
|
||||
### Comparison {.row-span-2}
|
||||
| - | - |
|
||||
|-----|------------------------------|
|
||||
| - | - |
|
||||
|-------|------------------------------|
|
||||
| `==` | Equal |
|
||||
| `===` | Identical |
|
||||
| `!=` | Not equal |
|
||||
@@ -511,14 +511,14 @@ PHP Operators {.cols-4}
|
||||
| `<=>` | Less than/equal/greater than |
|
||||
|
||||
### Logical
|
||||
| - | - |
|
||||
|------|--------------|
|
||||
| `and` | And |
|
||||
| `or` | Or |
|
||||
| `xor` | Exclusive or |
|
||||
| `!` | Not |
|
||||
| `&&` | And |
|
||||
| `||` | Or |
|
||||
| - | - |
|
||||
|-------|--------------|
|
||||
| `and` | And |
|
||||
| `or` | Or |
|
||||
| `xor` | Exclusive or |
|
||||
| `!` | Not |
|
||||
| `&&` | And |
|
||||
| `||` | Or |
|
||||
|
||||
|
||||
|
||||
@@ -542,8 +542,8 @@ $num /= $float; // Divide and assign the quotient to $num
|
||||
|
||||
|
||||
### Bitwise
|
||||
| - | - |
|
||||
|----|--------------------|
|
||||
| - | - |
|
||||
|------|--------------------|
|
||||
| `&` | And |
|
||||
| `|` | Or (inclusive or) |
|
||||
| `^` | Xor (exclusive or) |
|
||||
|
||||
+63
-63
@@ -58,11 +58,11 @@ postgres=# \!
|
||||
|
||||
### Getting help
|
||||
|
||||
| - | - |
|
||||
|-------------|-------------------------------------|
|
||||
| `\h` | Help on syntax of SQL commands |
|
||||
| `\h` DELETE | DELETE SQL statement syntax |
|
||||
| `\?` | List of PostgreSQL command |
|
||||
| - | - |
|
||||
|-------------|--------------------------------|
|
||||
| `\h` | Help on syntax of SQL commands |
|
||||
| `\h` DELETE | DELETE SQL statement syntax |
|
||||
| `\?` | List of PostgreSQL command |
|
||||
|
||||
Run in PostgreSQL console
|
||||
|
||||
@@ -351,71 +351,71 @@ PostgreSQL Commands {.cols-3}
|
||||
|
||||
|
||||
### Query buffer
|
||||
| - | - |
|
||||
|------------------|------------------------------------------------------|
|
||||
| `\e [FILE]` | Edit the query buffer (or file) |
|
||||
| `\ef [FUNC]` | Edit function definition |
|
||||
| `\p` | Show the contents |
|
||||
| `\r` | Reset (clear) the query buffer |
|
||||
| `\s [FILE]` | Display history or save it to file |
|
||||
| `\w FILE` | Write query buffer to file |
|
||||
| - | - |
|
||||
|--------------|------------------------------------|
|
||||
| `\e [FILE]` | Edit the query buffer (or file) |
|
||||
| `\ef [FUNC]` | Edit function definition |
|
||||
| `\p` | Show the contents |
|
||||
| `\r` | Reset (clear) the query buffer |
|
||||
| `\s [FILE]` | Display history or save it to file |
|
||||
| `\w FILE` | Write query buffer to file |
|
||||
|
||||
|
||||
|
||||
### Informational {.row-span-4}
|
||||
| - | - |
|
||||
|-----------------|--------------------------------------------------|
|
||||
| `\l[+]` | List all databases |
|
||||
| `\dn[S+]` | List schemas |
|
||||
| `\di[S+]` | List indexes |
|
||||
| `\du[+]` | List roles |
|
||||
| `\ds[S+]` | List sequences |
|
||||
| `\df[antw][S+]` | List functions |
|
||||
| `\deu[+]` | List user mappings |
|
||||
| `\dv[S+]` | List views |
|
||||
| `\dl` | List large objects |
|
||||
| `\dT[S+]` | List data types |
|
||||
| `\da[S]` | List aggregates |
|
||||
| `\db[+]` | List tablespaces |
|
||||
| `\dc[S+]` | List conversions |
|
||||
| `\dC[+]` | List casts |
|
||||
| `\ddp` | List default privileges |
|
||||
| `\dd[S]` | Show object descriptions |
|
||||
| `\dD[S+]` | List domains |
|
||||
| `\des[+]` | List foreign servers |
|
||||
| `\dew[+]` | List foreign-data wrappers |
|
||||
| `\dF[+]` | List text search configurations |
|
||||
| `\dFd[+]` | List text search dictionaries |
|
||||
| `\dFp[+]` | List text search parsers |
|
||||
| `\dFt[+]` | List text search templates |
|
||||
| `\dL[S+]` | List procedural languages |
|
||||
| `\do[S]` | List operators |
|
||||
| `\dO[S+]` | List collations |
|
||||
| `\drds` | List per-database role settings |
|
||||
| `\dx[+]` | List extensions |
|
||||
| - | - |
|
||||
|-----------------|---------------------------------|
|
||||
| `\l[+]` | List all databases |
|
||||
| `\dn[S+]` | List schemas |
|
||||
| `\di[S+]` | List indexes |
|
||||
| `\du[+]` | List roles |
|
||||
| `\ds[S+]` | List sequences |
|
||||
| `\df[antw][S+]` | List functions |
|
||||
| `\deu[+]` | List user mappings |
|
||||
| `\dv[S+]` | List views |
|
||||
| `\dl` | List large objects |
|
||||
| `\dT[S+]` | List data types |
|
||||
| `\da[S]` | List aggregates |
|
||||
| `\db[+]` | List tablespaces |
|
||||
| `\dc[S+]` | List conversions |
|
||||
| `\dC[+]` | List casts |
|
||||
| `\ddp` | List default privileges |
|
||||
| `\dd[S]` | Show object descriptions |
|
||||
| `\dD[S+]` | List domains |
|
||||
| `\des[+]` | List foreign servers |
|
||||
| `\dew[+]` | List foreign-data wrappers |
|
||||
| `\dF[+]` | List text search configurations |
|
||||
| `\dFd[+]` | List text search dictionaries |
|
||||
| `\dFp[+]` | List text search parsers |
|
||||
| `\dFt[+]` | List text search templates |
|
||||
| `\dL[S+]` | List procedural languages |
|
||||
| `\do[S]` | List operators |
|
||||
| `\dO[S+]` | List collations |
|
||||
| `\drds` | List per-database role settings |
|
||||
| `\dx[+]` | List extensions |
|
||||
|
||||
`S`: show system objects, `+`: additional detail
|
||||
|
||||
|
||||
### Connection
|
||||
| - | - |
|
||||
|------------------------|----------------------------------------------|
|
||||
| `\c [DBNAME]` | Connect to new database |
|
||||
| `\encoding [ENCODING]` | Show or set client encoding |
|
||||
| `\password [USER]` | Change the password |
|
||||
| `\conninfo` | Display information |
|
||||
| - | - |
|
||||
|------------------------|-----------------------------|
|
||||
| `\c [DBNAME]` | Connect to new database |
|
||||
| `\encoding [ENCODING]` | Show or set client encoding |
|
||||
| `\password [USER]` | Change the password |
|
||||
| `\conninfo` | Display information |
|
||||
|
||||
|
||||
### Formatting
|
||||
| - | - |
|
||||
|----------------|--------------------------------------------------------|
|
||||
| `\a` | Toggle between unaligned and aligned |
|
||||
| `\C [STRING]` | Set table title, or unset if none |
|
||||
| `\f [STRING]` | Show or set field separator for unaligned |
|
||||
| `\H` | Toggle HTML output mode |
|
||||
| `\t [on|off]` | Show only rows |
|
||||
| `\T [STRING]` | Set or unset HTML \<table\> tag attributes |
|
||||
| `\x [on|off]` | Toggle expanded output |
|
||||
| - | - |
|
||||
|---------------|--------------------------------------------|
|
||||
| `\a` | Toggle between unaligned and aligned |
|
||||
| `\C [STRING]` | Set table title, or unset if none |
|
||||
| `\f [STRING]` | Show or set field separator for unaligned |
|
||||
| `\H` | Toggle HTML output mode |
|
||||
| `\t [on|off]` | Show only rows |
|
||||
| `\T [STRING]` | Set or unset HTML \<table\> tag attributes |
|
||||
| `\x [on|off]` | Toggle expanded output |
|
||||
|
||||
|
||||
|
||||
@@ -424,17 +424,17 @@ PostgreSQL Commands {.cols-3}
|
||||
|-------------------|----------------------------------------------------------------|
|
||||
| `\copy ...` | Import/export table<br> _See also:_ [copy](#import-export-csv) |
|
||||
| `\echo [STRING]` | Print string |
|
||||
| `\i FILE` | Execute file |
|
||||
| `\i FILE` | Execute file |
|
||||
| `\o [FILE]` | Export all results to file |
|
||||
| `\qecho [STRING]` | String to output stream |
|
||||
|
||||
|
||||
### Variables
|
||||
| - | - |
|
||||
|-----------------------|-----------------------------------------------------|
|
||||
| `\prompt [TEXT] NAME` | Set variable |
|
||||
| - | - |
|
||||
|-----------------------|-----------------------------------------------|
|
||||
| `\prompt [TEXT] NAME` | Set variable |
|
||||
| `\set [NAME [VALUE]]` | Set variable _(or list all if no parameters)_ |
|
||||
| `\unset NAME` | Delete variable |
|
||||
| `\unset NAME` | Delete variable |
|
||||
|
||||
|
||||
### Misc
|
||||
|
||||
@@ -47,15 +47,15 @@ Python has no command for declaring a variable.
|
||||
|
||||
|
||||
### Data Types {.row-span-2}
|
||||
| | |
|
||||
|--------------------------------|----------------|
|
||||
| `str` | Text |
|
||||
| `int`, `float`, `complex` | Numeric |
|
||||
| | |
|
||||
|------------------------------------|----------|
|
||||
| `str` | Text |
|
||||
| `int`, `float`, `complex` | Numeric |
|
||||
| `list`, `tuple`, `range` | Sequence |
|
||||
| `dict` | Mapping |
|
||||
| `set`, `frozenset` | Set |
|
||||
| `bool` | Boolean |
|
||||
| `bytes`, `bytearray`, `memoryview` | Binary |
|
||||
| `dict` | Mapping |
|
||||
| `set`, `frozenset` | Set |
|
||||
| `bool` | Boolean |
|
||||
| `bytes`, `bytearray`, `memoryview` | Binary |
|
||||
See: [Data Types](#data-types-2)
|
||||
|
||||
|
||||
|
||||
+7
-7
@@ -269,7 +269,7 @@ Add `{.shortcuts}` to tables.
|
||||
### Show headers
|
||||
|
||||
| Prefix | Example | What |
|
||||
| --- | --- | --- |
|
||||
|--------|-----------------------|----------|
|
||||
| `//` | `//hr[@class='edge']` | Anywhere |
|
||||
| `./` | `./a` | Relative |
|
||||
| `/` | `/html/body/div` | Root |
|
||||
@@ -281,13 +281,13 @@ Add `{.show-header}` to add headers.
|
||||
### Rowspan {.col-span-2}
|
||||
| Stage | Direct Products | ATP Yields |
|
||||
|--------------------|-----------------|------------|
|
||||
| Glycolysis | 2 ATP ||
|
||||
| Glycolysis | 2 ATP | |
|
||||
| ^^ | 2 NADH | 3--5 ATP |
|
||||
| Pyruvaye oxidation | 2 NADH | 5 ATP |
|
||||
| Citric acid cycle | 2 ATP ||
|
||||
| Citric acid cycle | 2 ATP | |
|
||||
| ^^ | 6 NADH | 15 ATP |
|
||||
| ^^ | 2 FADH2 | 3 ATP |
|
||||
| **30--32** ATP |||
|
||||
| **30--32** ATP | | |
|
||||
{.show-header}
|
||||
|
||||
#### Source Code
|
||||
@@ -295,13 +295,13 @@ Add `{.show-header}` to add headers.
|
||||
```
|
||||
| Stage | Direct Products | ATP Yields |
|
||||
|--------------------|-----------------|------------|
|
||||
| Glycolysis | 2 ATP ||
|
||||
| Glycolysis | 2 ATP | |
|
||||
| ^^ | 2 NADH | 3--5 ATP |
|
||||
| Pyruvaye oxidation | 2 NADH | 5 ATP |
|
||||
| Citric acid cycle | 2 ATP ||
|
||||
| Citric acid cycle | 2 ATP | |
|
||||
| ^^ | 6 NADH | 15 ATP |
|
||||
| ^^ | 2 FADH2 | 3 ATP |
|
||||
| **30--32** ATP |||
|
||||
| **30--32** ATP | | |
|
||||
{.show-header}
|
||||
```
|
||||
|
||||
|
||||
@@ -897,10 +897,10 @@ Redis List command {.cols-3}
|
||||
|
||||
### Misc
|
||||
|
||||
| - | - |
|
||||
|----|----|
|
||||
| - | - |
|
||||
|-----------------------------------------------------|----------------------------------------------------------------------------------------------------|
|
||||
| [BRPOPLPUSH ](https://redis.io/commands/brpoplpush) | Pop an element from a list, push it to another list and return it; or block until one is available |
|
||||
| [BLMOVE ](https://redis.io/commands/blmove) | Pop an element from a list, push it to another list and return it; or block until one is available |
|
||||
| [BLMOVE ](https://redis.io/commands/blmove) | Pop an element from a list, push it to another list and return it; or block until one is available |
|
||||
|
||||
|
||||
|
||||
@@ -2412,8 +2412,8 @@ redis> GEOSEARCH Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC
|
||||
Query a sorted set representing a geospatial index to fetch members inside an area of a box or a circle.
|
||||
|
||||
### Misc
|
||||
| - | - |
|
||||
|----|----|
|
||||
| - | - |
|
||||
|-------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| [GEOSEARCHSTORE ](https://redis.io/commands/geosearchstore) | Query a sorted set representing a geospatial index to fetch members inside an area of a box or a circle, and store the result in another key. |
|
||||
|
||||
|
||||
@@ -2514,57 +2514,57 @@ Get array of Redis command details
|
||||
|
||||
### Misc {.col-span-2 .row-span-4}
|
||||
|
||||
| - | - |
|
||||
|----|----|
|
||||
| [ACL LOAD](https://redis.io/commands/acl-load) | Reload the ACLs from the configured ACL file |
|
||||
| [ACL SAVE](https://redis.io/commands/acl-save) | Save the current ACL rules in the configured ACL file |
|
||||
| [ACL LIST](https://redis.io/commands/acl-list) | List the current ACL rules in ACL config file format |
|
||||
| [ACL USERS](https://redis.io/commands/acl-users) | List the username of all the configured ACL rules |
|
||||
| [ACL GETUSER ](https://redis.io/commands/acl-getuser) | Get the rules for a specific ACL user |
|
||||
| [ACL SETUSER ](https://redis.io/commands/acl-setuser) | Modify or create the rules for a specific ACL user |
|
||||
| [ACL DELUSER ](https://redis.io/commands/acl-deluser) | Remove the specified ACL users and the associated rules |
|
||||
| [ACL CAT ](https://redis.io/commands/acl-cat) | List the ACL categories or the commands inside a category |
|
||||
| [ACL GENPASS ](https://redis.io/commands/acl-genpass) | Generate a pseudorandom secure password to use for ACL users |
|
||||
| [ACL WHOAMI](https://redis.io/commands/acl-whoami) | Return the name of the user associated to the current connection |
|
||||
| [ACL LOG ](https://redis.io/commands/acl-log) | List latest events denied because of ACLs in place |
|
||||
| [ACL HELP](https://redis.io/commands/acl-help) | Show helpful text about the different subcommands |
|
||||
| [BGREWRITEAOF](https://redis.io/commands/bgrewriteaof) | Asynchronously rewrite the append-only file |
|
||||
| [BGSAVE ](https://redis.io/commands/bgsave) | Asynchronously save the dataset to disk |
|
||||
| [CONFIG GET ](https://redis.io/commands/config-get) | Get the value of a configuration parameter |
|
||||
| [CONFIG REWRITE](https://redis.io/commands/config-rewrite) | Rewrite the configuration file with the in memory configuration |
|
||||
| [CONFIG SET ](https://redis.io/commands/config-set) | Set a configuration parameter to the given value |
|
||||
| [CONFIG RESETSTAT](https://redis.io/commands/config-resetstat) | Reset the stats returned by INFO |
|
||||
| [DBSIZE](https://redis.io/commands/dbsize) | Return the number of keys in the selected database |
|
||||
| [DEBUG OBJECT ](https://redis.io/commands/debug-object) | Get debugging information about a key |
|
||||
| [DEBUG SEGFAULT](https://redis.io/commands/debug-segfault) | Make the server crash |
|
||||
| [FLUSHALL ](https://redis.io/commands/flushall) | Remove all keys from all databases |
|
||||
| [FLUSHDB ](https://redis.io/commands/flushdb) | Remove all keys from the current database |
|
||||
| [LOLWUT ](https://redis.io/commands/lolwut) | Display some computer art and the Redis version |
|
||||
| [LASTSAVE](https://redis.io/commands/lastsave) | Get the UNIX time stamp of the last successful save to disk |
|
||||
| [MEMORY DOCTOR](https://redis.io/commands/memory-doctor) | Outputs memory problems report |
|
||||
| [MEMORY HELP](https://redis.io/commands/memory-help) | Show helpful text about the different subcommands |
|
||||
| [MEMORY MALLOC-STATS](https://redis.io/commands/memory-malloc-stats) | Show allocator internal stats |
|
||||
| [MEMORY PURGE](https://redis.io/commands/memory-purge) | Ask the allocator to release memory |
|
||||
| [MEMORY STATS](https://redis.io/commands/memory-stats) | Show memory usage details |
|
||||
| [MEMORY USAGE ](https://redis.io/commands/memory-usage) | Estimate the memory usage of a key |
|
||||
| [MODULE LIST](https://redis.io/commands/module-list) | List all modules loaded by the server |
|
||||
| [MODULE LOAD ](https://redis.io/commands/module-load) | Load a module |
|
||||
| [MODULE UNLOAD ](https://redis.io/commands/module-unload) | Unload a module |
|
||||
| [MONITOR](https://redis.io/commands/monitor) | Listen for all requests received by the server in real time |
|
||||
| [SAVE](https://redis.io/commands/save) | Synchronously save the dataset to disk |
|
||||
| [SHUTDOWN ](https://redis.io/commands/shutdown) | Synchronously save the dataset to disk and then shut down the server |
|
||||
| [SLAVEOF ](https://redis.io/commands/slaveof) | Make the server a replica of another instance, or promote it as master. Deprecated starting with Redis 5. Use REPLICAOF instead. |
|
||||
| [REPLICAOF ](https://redis.io/commands/replicaof) | Make the server a replica of another instance, or promote it as master. |
|
||||
| [SLOWLOG ](https://redis.io/commands/slowlog) | Manages the Redis slow queries log |
|
||||
| [SWAPDB ](https://redis.io/commands/swapdb) | Swaps two Redis databases |
|
||||
| [SYNC](https://redis.io/commands/sync) | Internal command used for replication |
|
||||
| [PSYNC ](https://redis.io/commands/psync) | Internal command used for replication |
|
||||
| [LATENCY DOCTOR](https://redis.io/commands/latency-doctor) | Return a human readable latency analysis report. |
|
||||
| [LATENCY GRAPH ](https://redis.io/commands/latency-graph) | Return a latency graph for the event. |
|
||||
| [LATENCY HISTORY ](https://redis.io/commands/latency-history) | Return timestamp-latency samples for the event. |
|
||||
| [LATENCY LATEST](https://redis.io/commands/latency-latest) | Return the latest latency samples for all events. |
|
||||
| [LATENCY RESET ](https://redis.io/commands/latency-reset) | Reset latency data for one or more events. |
|
||||
| [LATENCY HELP](https://redis.io/commands/latency-help) | Show helpful text about the different subcommands. |
|
||||
| - | - |
|
||||
|----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
|
||||
| [ACL LOAD](https://redis.io/commands/acl-load) | Reload the ACLs from the configured ACL file |
|
||||
| [ACL SAVE](https://redis.io/commands/acl-save) | Save the current ACL rules in the configured ACL file |
|
||||
| [ACL LIST](https://redis.io/commands/acl-list) | List the current ACL rules in ACL config file format |
|
||||
| [ACL USERS](https://redis.io/commands/acl-users) | List the username of all the configured ACL rules |
|
||||
| [ACL GETUSER ](https://redis.io/commands/acl-getuser) | Get the rules for a specific ACL user |
|
||||
| [ACL SETUSER ](https://redis.io/commands/acl-setuser) | Modify or create the rules for a specific ACL user |
|
||||
| [ACL DELUSER ](https://redis.io/commands/acl-deluser) | Remove the specified ACL users and the associated rules |
|
||||
| [ACL CAT ](https://redis.io/commands/acl-cat) | List the ACL categories or the commands inside a category |
|
||||
| [ACL GENPASS ](https://redis.io/commands/acl-genpass) | Generate a pseudorandom secure password to use for ACL users |
|
||||
| [ACL WHOAMI](https://redis.io/commands/acl-whoami) | Return the name of the user associated to the current connection |
|
||||
| [ACL LOG ](https://redis.io/commands/acl-log) | List latest events denied because of ACLs in place |
|
||||
| [ACL HELP](https://redis.io/commands/acl-help) | Show helpful text about the different subcommands |
|
||||
| [BGREWRITEAOF](https://redis.io/commands/bgrewriteaof) | Asynchronously rewrite the append-only file |
|
||||
| [BGSAVE ](https://redis.io/commands/bgsave) | Asynchronously save the dataset to disk |
|
||||
| [CONFIG GET ](https://redis.io/commands/config-get) | Get the value of a configuration parameter |
|
||||
| [CONFIG REWRITE](https://redis.io/commands/config-rewrite) | Rewrite the configuration file with the in memory configuration |
|
||||
| [CONFIG SET ](https://redis.io/commands/config-set) | Set a configuration parameter to the given value |
|
||||
| [CONFIG RESETSTAT](https://redis.io/commands/config-resetstat) | Reset the stats returned by INFO |
|
||||
| [DBSIZE](https://redis.io/commands/dbsize) | Return the number of keys in the selected database |
|
||||
| [DEBUG OBJECT ](https://redis.io/commands/debug-object) | Get debugging information about a key |
|
||||
| [DEBUG SEGFAULT](https://redis.io/commands/debug-segfault) | Make the server crash |
|
||||
| [FLUSHALL ](https://redis.io/commands/flushall) | Remove all keys from all databases |
|
||||
| [FLUSHDB ](https://redis.io/commands/flushdb) | Remove all keys from the current database |
|
||||
| [LOLWUT ](https://redis.io/commands/lolwut) | Display some computer art and the Redis version |
|
||||
| [LASTSAVE](https://redis.io/commands/lastsave) | Get the UNIX time stamp of the last successful save to disk |
|
||||
| [MEMORY DOCTOR](https://redis.io/commands/memory-doctor) | Outputs memory problems report |
|
||||
| [MEMORY HELP](https://redis.io/commands/memory-help) | Show helpful text about the different subcommands |
|
||||
| [MEMORY MALLOC-STATS](https://redis.io/commands/memory-malloc-stats) | Show allocator internal stats |
|
||||
| [MEMORY PURGE](https://redis.io/commands/memory-purge) | Ask the allocator to release memory |
|
||||
| [MEMORY STATS](https://redis.io/commands/memory-stats) | Show memory usage details |
|
||||
| [MEMORY USAGE ](https://redis.io/commands/memory-usage) | Estimate the memory usage of a key |
|
||||
| [MODULE LIST](https://redis.io/commands/module-list) | List all modules loaded by the server |
|
||||
| [MODULE LOAD ](https://redis.io/commands/module-load) | Load a module |
|
||||
| [MODULE UNLOAD ](https://redis.io/commands/module-unload) | Unload a module |
|
||||
| [MONITOR](https://redis.io/commands/monitor) | Listen for all requests received by the server in real time |
|
||||
| [SAVE](https://redis.io/commands/save) | Synchronously save the dataset to disk |
|
||||
| [SHUTDOWN ](https://redis.io/commands/shutdown) | Synchronously save the dataset to disk and then shut down the server |
|
||||
| [SLAVEOF ](https://redis.io/commands/slaveof) | Make the server a replica of another instance, or promote it as master. Deprecated starting with Redis 5. Use REPLICAOF instead. |
|
||||
| [REPLICAOF ](https://redis.io/commands/replicaof) | Make the server a replica of another instance, or promote it as master. |
|
||||
| [SLOWLOG ](https://redis.io/commands/slowlog) | Manages the Redis slow queries log |
|
||||
| [SWAPDB ](https://redis.io/commands/swapdb) | Swaps two Redis databases |
|
||||
| [SYNC](https://redis.io/commands/sync) | Internal command used for replication |
|
||||
| [PSYNC ](https://redis.io/commands/psync) | Internal command used for replication |
|
||||
| [LATENCY DOCTOR](https://redis.io/commands/latency-doctor) | Return a human readable latency analysis report. |
|
||||
| [LATENCY GRAPH ](https://redis.io/commands/latency-graph) | Return a latency graph for the event. |
|
||||
| [LATENCY HISTORY ](https://redis.io/commands/latency-history) | Return timestamp-latency samples for the event. |
|
||||
| [LATENCY LATEST](https://redis.io/commands/latency-latest) | Return the latest latency samples for all events. |
|
||||
| [LATENCY RESET ](https://redis.io/commands/latency-reset) | Reset latency data for one or more events. |
|
||||
| [LATENCY HELP](https://redis.io/commands/latency-help) | Show helpful text about the different subcommands. |
|
||||
|
||||
|
||||
|
||||
@@ -2705,16 +2705,16 @@ Redis Generic command{.cols-3}
|
||||
|
||||
### Misc
|
||||
|
||||
| - | - |
|
||||
|----|----|
|
||||
| [COPY ](https://redis.io/commands/copy) | Copy a key |
|
||||
| [MIGRATE ](https://redis.io/commands/migrate) | Atomically transfer a key from a Redis instance to another one. |
|
||||
| [MOVE ](https://redis.io/commands/move) | Move a key to another database |
|
||||
| [OBJECT ](https://redis.io/commands/object) | Inspect the internals of Redis objects |
|
||||
| [RESTORE ](https://redis.io/commands/restore) | Create a key using the provided serialized value, previously obtained using DUMP. |
|
||||
| [SORT ](https://redis.io/commands/sort) | Sort the elements in a list, set or sorted set |
|
||||
| [WAIT ](https://redis.io/commands/wait) | Wait for the synchronous replication of all the write commands sent in the context of the current connection |
|
||||
| [SCAN ](https://redis.io/commands/scan) | Incrementally iterate the keys space |
|
||||
| - | - |
|
||||
|-----------------------------------------------|--------------------------------------------------------------------------------------------------------------|
|
||||
| [COPY ](https://redis.io/commands/copy) | Copy a key |
|
||||
| [MIGRATE ](https://redis.io/commands/migrate) | Atomically transfer a key from a Redis instance to another one. |
|
||||
| [MOVE ](https://redis.io/commands/move) | Move a key to another database |
|
||||
| [OBJECT ](https://redis.io/commands/object) | Inspect the internals of Redis objects |
|
||||
| [RESTORE ](https://redis.io/commands/restore) | Create a key using the provided serialized value, previously obtained using DUMP. |
|
||||
| [SORT ](https://redis.io/commands/sort) | Sort the elements in a list, set or sorted set |
|
||||
| [WAIT ](https://redis.io/commands/wait) | Wait for the synchronous replication of all the write commands sent in the context of the current connection |
|
||||
| [SCAN ](https://redis.io/commands/scan) | Incrementally iterate the keys space |
|
||||
|
||||
|
||||
|
||||
@@ -3027,23 +3027,23 @@ Redis Connection command{.cols-3}
|
||||
|
||||
### Misc
|
||||
|
||||
| - | - |
|
||||
|----|----|
|
||||
| [AUTH ](https://redis.io/commands/auth) | Authenticate to the server |
|
||||
| [CLIENT CACHING ](https://redis.io/commands/client-caching) | Instruct the server about tracking or not keys in the next request |
|
||||
| [CLIENT KILL ](https://redis.io/commands/client-kill) | Kill the connection of a client |
|
||||
| [CLIENT LIST ](https://redis.io/commands/client-list) | Get the list of client connections |
|
||||
| [CLIENT GETNAME](https://redis.io/commands/client-getname) | Get the current connection name |
|
||||
| [CLIENT GETREDIR](https://redis.io/commands/client-getredir) | Get tracking notifications redirection client ID if any |
|
||||
| [CLIENT PAUSE ](https://redis.io/commands/client-pause) | Stop processing commands from clients for some time |
|
||||
| [CLIENT REPLY ](https://redis.io/commands/client-reply) | Instruct the server whether to reply to commands |
|
||||
| [CLIENT SETNAME ](https://redis.io/commands/client-setname) | Set the current connection name |
|
||||
| [CLIENT TRACKING ](https://redis.io/commands/client-tracking) | Enable or disable server assisted client side caching support |
|
||||
| [CLIENT UNBLOCK ](https://redis.io/commands/client-unblock) | Unblock a client blocked in a blocking command from a different connection |
|
||||
| [HELLO ](https://redis.io/commands/hello) | switch Redis protocol |
|
||||
| [QUIT](https://redis.io/commands/quit) | Close the connection |
|
||||
| [RESET](https://redis.io/commands/reset) | Reset the connection |
|
||||
| [SELECT ](https://redis.io/commands/select) | Change the selected database for the current connection |
|
||||
| - | - |
|
||||
|---------------------------------------------------------------|----------------------------------------------------------------------------|
|
||||
| [AUTH ](https://redis.io/commands/auth) | Authenticate to the server |
|
||||
| [CLIENT CACHING ](https://redis.io/commands/client-caching) | Instruct the server about tracking or not keys in the next request |
|
||||
| [CLIENT KILL ](https://redis.io/commands/client-kill) | Kill the connection of a client |
|
||||
| [CLIENT LIST ](https://redis.io/commands/client-list) | Get the list of client connections |
|
||||
| [CLIENT GETNAME](https://redis.io/commands/client-getname) | Get the current connection name |
|
||||
| [CLIENT GETREDIR](https://redis.io/commands/client-getredir) | Get tracking notifications redirection client ID if any |
|
||||
| [CLIENT PAUSE ](https://redis.io/commands/client-pause) | Stop processing commands from clients for some time |
|
||||
| [CLIENT REPLY ](https://redis.io/commands/client-reply) | Instruct the server whether to reply to commands |
|
||||
| [CLIENT SETNAME ](https://redis.io/commands/client-setname) | Set the current connection name |
|
||||
| [CLIENT TRACKING ](https://redis.io/commands/client-tracking) | Enable or disable server assisted client side caching support |
|
||||
| [CLIENT UNBLOCK ](https://redis.io/commands/client-unblock) | Unblock a client blocked in a blocking command from a different connection |
|
||||
| [HELLO ](https://redis.io/commands/hello) | switch Redis protocol |
|
||||
| [QUIT](https://redis.io/commands/quit) | Close the connection |
|
||||
| [RESET](https://redis.io/commands/reset) | Reset the connection |
|
||||
| [SELECT ](https://redis.io/commands/select) | Change the selected database for the current connection |
|
||||
|
||||
|
||||
|
||||
@@ -3112,15 +3112,15 @@ Redis Stream command{.cols-2}
|
||||
|
||||
### Misc
|
||||
|
||||
| - | - |
|
||||
|----|----|
|
||||
| [XINFO ](https://redis.io/commands/xinfo) | Get information on streams and consumer groups |
|
||||
| [XDEL ](https://redis.io/commands/xdel) | Removes the specified entries from the stream. Returns the number of items actually deleted, that may be different from the number of IDs passed in case certain IDs do not exist. |
|
||||
| [XREAD ](https://redis.io/commands/xread) | Return never seen elements in multiple streams, with IDs greater than the ones reported by the caller for each stream. Can block. |
|
||||
| [XGROUP ](https://redis.io/commands/xgroup) | Create, destroy, and manage consumer groups. |
|
||||
| [XREADGROUP ](https://redis.io/commands/xreadgroup) | Return new entries from a stream using a consumer group, or access the history of the pending entries for a given consumer. Can block. |
|
||||
| [XCLAIM ](https://redis.io/commands/xclaim) | Changes (or acquires) ownership of a message in a consumer group, as if the message was delivered to the specified consumer. |
|
||||
| [XPENDING ](https://redis.io/commands/xpending) | Return information and entries from a stream consumer group pending entries list, that are messages fetched but never acknowledged. |
|
||||
| - | - |
|
||||
|-----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| [XINFO ](https://redis.io/commands/xinfo) | Get information on streams and consumer groups |
|
||||
| [XDEL ](https://redis.io/commands/xdel) | Removes the specified entries from the stream. Returns the number of items actually deleted, that may be different from the number of IDs passed in case certain IDs do not exist. |
|
||||
| [XREAD ](https://redis.io/commands/xread) | Return never seen elements in multiple streams, with IDs greater than the ones reported by the caller for each stream. Can block. |
|
||||
| [XGROUP ](https://redis.io/commands/xgroup) | Create, destroy, and manage consumer groups. |
|
||||
| [XREADGROUP ](https://redis.io/commands/xreadgroup) | Return new entries from a stream using a consumer group, or access the history of the pending entries for a given consumer. Can block. |
|
||||
| [XCLAIM ](https://redis.io/commands/xclaim) | Changes (or acquires) ownership of a message in a consumer group, as if the message was delivered to the specified consumer. |
|
||||
| [XPENDING ](https://redis.io/commands/xpending) | Return information and entries from a stream consumer group pending entries list, that are messages fetched but never acknowledged. |
|
||||
|
||||
|
||||
|
||||
@@ -3287,71 +3287,71 @@ Miscellaneous {.cols-2}
|
||||
|
||||
### Cluster
|
||||
|
||||
| - | - |
|
||||
|----|----|
|
||||
| [CLUSTER ADDSLOTS ](https://redis.io/commands/cluster-addslots) | Assign new hash slots to receiving node |
|
||||
| [CLUSTER BUMPEPOCH](https://redis.io/commands/cluster-bumpepoch) | Advance the cluster config epoch |
|
||||
| [CLUSTER COUNT-FAILURE-REPORTS ](https://redis.io/commands/cluster-count-failure-reports) | Return the number of failure reports active for a given node |
|
||||
| [CLUSTER COUNTKEYSINSLOT ](https://redis.io/commands/cluster-countkeysinslot) | Return the number of local keys in the specified hash slot |
|
||||
| [CLUSTER DELSLOTS ](https://redis.io/commands/cluster-delslots) | Set hash slots as unbound in receiving node |
|
||||
| [CLUSTER FAILOVER ](https://redis.io/commands/cluster-failover) | Forces a replica to perform a manual failover of its master. |
|
||||
| [CLUSTER FLUSHSLOTS](https://redis.io/commands/cluster-flushslots) | Delete a node's own slots information |
|
||||
| [CLUSTER FORGET ](https://redis.io/commands/cluster-forget) | Remove a node from the nodes table |
|
||||
| [CLUSTER GETKEYSINSLOT ](https://redis.io/commands/cluster-getkeysinslot) | Return local key names in the specified hash slot |
|
||||
| [CLUSTER INFO](https://redis.io/commands/cluster-info) | Provides info about Redis Cluster node state |
|
||||
| [CLUSTER KEYSLOT ](https://redis.io/commands/cluster-keyslot) | Returns the hash slot of the specified key |
|
||||
| [CLUSTER MEET ](https://redis.io/commands/cluster-meet) | Force a node cluster to handshake with another node |
|
||||
| [CLUSTER MYID](https://redis.io/commands/cluster-myid) | Return the node id |
|
||||
| [CLUSTER NODES](https://redis.io/commands/cluster-nodes) | Get Cluster config for the node |
|
||||
| [CLUSTER REPLICATE ](https://redis.io/commands/cluster-replicate) | Reconfigure a node as a replica of the specified master node |
|
||||
| [CLUSTER RESET ](https://redis.io/commands/cluster-reset) | Reset a Redis Cluster node |
|
||||
| [CLUSTER SAVECONFIG](https://redis.io/commands/cluster-saveconfig) | Forces the node to save cluster state on disk |
|
||||
| [CLUSTER SET-CONFIG-EPOCH ](https://redis.io/commands/cluster-set-config-epoch) | Set the configuration epoch in a new node |
|
||||
| [CLUSTER SETSLOT ](https://redis.io/commands/cluster-setslot) | Bind a hash slot to a specific node |
|
||||
| [CLUSTER SLAVES ](https://redis.io/commands/cluster-slaves) | List replica nodes of the specified master node |
|
||||
| [CLUSTER REPLICAS ](https://redis.io/commands/cluster-replicas) | List replica nodes of the specified master node |
|
||||
| [CLUSTER SLOTS](https://redis.io/commands/cluster-slots) | Get array of Cluster slot to node mappings |
|
||||
| [READONLY](https://redis.io/commands/readonly) | Enables read queries for a connection to a cluster replica node |
|
||||
| [READWRITE](https://redis.io/commands/readwrite) | Disables read queries for a connection to a cluster replica node |
|
||||
| - | - |
|
||||
|-------------------------------------------------------------------------------------------|------------------------------------------------------------------|
|
||||
| [CLUSTER ADDSLOTS ](https://redis.io/commands/cluster-addslots) | Assign new hash slots to receiving node |
|
||||
| [CLUSTER BUMPEPOCH](https://redis.io/commands/cluster-bumpepoch) | Advance the cluster config epoch |
|
||||
| [CLUSTER COUNT-FAILURE-REPORTS ](https://redis.io/commands/cluster-count-failure-reports) | Return the number of failure reports active for a given node |
|
||||
| [CLUSTER COUNTKEYSINSLOT ](https://redis.io/commands/cluster-countkeysinslot) | Return the number of local keys in the specified hash slot |
|
||||
| [CLUSTER DELSLOTS ](https://redis.io/commands/cluster-delslots) | Set hash slots as unbound in receiving node |
|
||||
| [CLUSTER FAILOVER ](https://redis.io/commands/cluster-failover) | Forces a replica to perform a manual failover of its master. |
|
||||
| [CLUSTER FLUSHSLOTS](https://redis.io/commands/cluster-flushslots) | Delete a node's own slots information |
|
||||
| [CLUSTER FORGET ](https://redis.io/commands/cluster-forget) | Remove a node from the nodes table |
|
||||
| [CLUSTER GETKEYSINSLOT ](https://redis.io/commands/cluster-getkeysinslot) | Return local key names in the specified hash slot |
|
||||
| [CLUSTER INFO](https://redis.io/commands/cluster-info) | Provides info about Redis Cluster node state |
|
||||
| [CLUSTER KEYSLOT ](https://redis.io/commands/cluster-keyslot) | Returns the hash slot of the specified key |
|
||||
| [CLUSTER MEET ](https://redis.io/commands/cluster-meet) | Force a node cluster to handshake with another node |
|
||||
| [CLUSTER MYID](https://redis.io/commands/cluster-myid) | Return the node id |
|
||||
| [CLUSTER NODES](https://redis.io/commands/cluster-nodes) | Get Cluster config for the node |
|
||||
| [CLUSTER REPLICATE ](https://redis.io/commands/cluster-replicate) | Reconfigure a node as a replica of the specified master node |
|
||||
| [CLUSTER RESET ](https://redis.io/commands/cluster-reset) | Reset a Redis Cluster node |
|
||||
| [CLUSTER SAVECONFIG](https://redis.io/commands/cluster-saveconfig) | Forces the node to save cluster state on disk |
|
||||
| [CLUSTER SET-CONFIG-EPOCH ](https://redis.io/commands/cluster-set-config-epoch) | Set the configuration epoch in a new node |
|
||||
| [CLUSTER SETSLOT ](https://redis.io/commands/cluster-setslot) | Bind a hash slot to a specific node |
|
||||
| [CLUSTER SLAVES ](https://redis.io/commands/cluster-slaves) | List replica nodes of the specified master node |
|
||||
| [CLUSTER REPLICAS ](https://redis.io/commands/cluster-replicas) | List replica nodes of the specified master node |
|
||||
| [CLUSTER SLOTS](https://redis.io/commands/cluster-slots) | Get array of Cluster slot to node mappings |
|
||||
| [READONLY](https://redis.io/commands/readonly) | Enables read queries for a connection to a cluster replica node |
|
||||
| [READWRITE](https://redis.io/commands/readwrite) | Disables read queries for a connection to a cluster replica node |
|
||||
|
||||
|
||||
|
||||
|
||||
### Transactions
|
||||
|
||||
| - | - |
|
||||
|----|----|
|
||||
| [DISCARD](https://redis.io/commands/discard) | Discard all commands issued after MULTI |
|
||||
| [EXEC](https://redis.io/commands/exec) | Execute all commands issued after MULTI |
|
||||
| [MULTI](https://redis.io/commands/multi) | Mark the start of a transaction block |
|
||||
| [UNWATCH](https://redis.io/commands/unwatch) | Forget about all watched keys |
|
||||
| [WATCH ](https://redis.io/commands/watch) | Watch the given keys to determine execution of the MULTI/EXEC block |
|
||||
| - | - |
|
||||
|----------------------------------------------|---------------------------------------------------------------------|
|
||||
| [DISCARD](https://redis.io/commands/discard) | Discard all commands issued after MULTI |
|
||||
| [EXEC](https://redis.io/commands/exec) | Execute all commands issued after MULTI |
|
||||
| [MULTI](https://redis.io/commands/multi) | Mark the start of a transaction block |
|
||||
| [UNWATCH](https://redis.io/commands/unwatch) | Forget about all watched keys |
|
||||
| [WATCH ](https://redis.io/commands/watch) | Watch the given keys to determine execution of the MULTI/EXEC block |
|
||||
|
||||
|
||||
|
||||
|
||||
### Scripting
|
||||
|
||||
| - | - |
|
||||
|----|----|
|
||||
| [EVAL ](https://redis.io/commands/eval) | Execute a Lua script server side |
|
||||
| [EVALSHA ](https://redis.io/commands/evalsha) | Execute a Lua script server side |
|
||||
| [SCRIPT DEBUG ](https://redis.io/commands/script-debug) | Set the debug mode for executed scripts. |
|
||||
| [SCRIPT EXISTS ](https://redis.io/commands/script-exists) | Check existence of scripts in the script cache. |
|
||||
| [SCRIPT FLUSH](https://redis.io/commands/script-flush) | Remove all the scripts from the script cache. |
|
||||
| [SCRIPT KILL](https://redis.io/commands/script-kill) | Kill the script currently in execution. |
|
||||
| [SCRIPT LOAD ](https://redis.io/commands/script-load) | Load the specified Lua script into the script cache. |
|
||||
| - | - |
|
||||
|-----------------------------------------------------------|------------------------------------------------------|
|
||||
| [EVAL ](https://redis.io/commands/eval) | Execute a Lua script server side |
|
||||
| [EVALSHA ](https://redis.io/commands/evalsha) | Execute a Lua script server side |
|
||||
| [SCRIPT DEBUG ](https://redis.io/commands/script-debug) | Set the debug mode for executed scripts. |
|
||||
| [SCRIPT EXISTS ](https://redis.io/commands/script-exists) | Check existence of scripts in the script cache. |
|
||||
| [SCRIPT FLUSH](https://redis.io/commands/script-flush) | Remove all the scripts from the script cache. |
|
||||
| [SCRIPT KILL](https://redis.io/commands/script-kill) | Kill the script currently in execution. |
|
||||
| [SCRIPT LOAD ](https://redis.io/commands/script-load) | Load the specified Lua script into the script cache. |
|
||||
|
||||
|
||||
|
||||
### Pubsub
|
||||
|
||||
| - | - |
|
||||
|----|----|
|
||||
| [PSUBSCRIBE ](https://redis.io/commands/psubscribe) | Listen for messages published to channels matching the given patterns |
|
||||
| [PUBSUB ](https://redis.io/commands/pubsub) | Inspect the state of the Pub/Sub subsystem |
|
||||
| [PUBLISH ](https://redis.io/commands/publish) | Post a message to a channel |
|
||||
| - | - |
|
||||
|---------------------------------------------------------|----------------------------------------------------------------------------|
|
||||
| [PSUBSCRIBE ](https://redis.io/commands/psubscribe) | Listen for messages published to channels matching the given patterns |
|
||||
| [PUBSUB ](https://redis.io/commands/pubsub) | Inspect the state of the Pub/Sub subsystem |
|
||||
| [PUBLISH ](https://redis.io/commands/publish) | Post a message to a channel |
|
||||
| [PUNSUBSCRIBE ](https://redis.io/commands/punsubscribe) | Stop listening for messages posted to channels matching the given patterns |
|
||||
| [SUBSCRIBE ](https://redis.io/commands/subscribe) | Listen for messages published to the given channels |
|
||||
| [UNSUBSCRIBE ](https://redis.io/commands/unsubscribe) | Stop listening for messages posted to the given channels |
|
||||
| [SUBSCRIBE ](https://redis.io/commands/subscribe) | Listen for messages published to the given channels |
|
||||
| [UNSUBSCRIBE ](https://redis.io/commands/unsubscribe) | Stop listening for messages posted to the given channels |
|
||||
|
||||
@@ -32,24 +32,24 @@ This is a quick cheat sheet to getting started with regular expressions.
|
||||
|
||||
### Character Classes
|
||||
|
||||
| Pattern | Description |
|
||||
|------------|--------------------------------------|
|
||||
|`[abc]` | A single character of: a, b or c|
|
||||
|`[^abc]` | A character except: a, b or c|
|
||||
|`[a-z]` | A character in the range: a-z|
|
||||
|`[^a-z]` | A character not in the range: a-z|
|
||||
|`[0-9]` | A digit in the range: 0-9|
|
||||
|`[a-zA-Z]` | A character in the range:<br>a-z or A-Z|
|
||||
|`[a-zA-Z0-9]` | A character in the range: <br>a-z, A-Z or 0-9|
|
||||
| Pattern | Description |
|
||||
|---------------|-----------------------------------------------|
|
||||
| `[abc]` | A single character of: a, b or c |
|
||||
| `[^abc]` | A character except: a, b or c |
|
||||
| `[a-z]` | A character in the range: a-z |
|
||||
| `[^a-z]` | A character not in the range: a-z |
|
||||
| `[0-9]` | A digit in the range: 0-9 |
|
||||
| `[a-zA-Z]` | A character in the range:<br>a-z or A-Z |
|
||||
| `[a-zA-Z0-9]` | A character in the range: <br>a-z, A-Z or 0-9 |
|
||||
|
||||
|
||||
### Quantifiers
|
||||
|
||||
| Pattern | Description |
|
||||
|------------|--------------------------------------|
|
||||
|`a?` | Zero or one of a|
|
||||
|`a*` | Zero or more of a|
|
||||
|`a+` | One or more of a|
|
||||
| Pattern | Description |
|
||||
|---------|-------------------|
|
||||
| `a?` | Zero or one of a |
|
||||
| `a*` | Zero or more of a |
|
||||
| `a+` | One or more of a |
|
||||
|
||||
|`[0-9]+` | One or more of 0-9|
|
||||
|
||||
@@ -92,99 +92,99 @@ Escape these special characters with `\`
|
||||
|
||||
### Meta Sequences {.row-span-4}
|
||||
|
||||
| Pattern | Description |
|
||||
|------------|--------------------------------------|
|
||||
|`.` | Any single character|
|
||||
|`\s` | Any whitespace character|
|
||||
|`\S` | Any non-whitespace character|
|
||||
|`\d` | Any digit, Same as [0-9]|
|
||||
|`\D` | Any non-digit, Same as [^0-9]|
|
||||
|`\w` | Any word character |
|
||||
|`\W` | Any non-word character |
|
||||
|`\X` | Any Unicode sequences, linebreaks included|
|
||||
|`\C` | Match one data unit|
|
||||
|`\R` | Unicode newlines|
|
||||
|`\v` | Vertical whitespace character|
|
||||
|`\V` | Negation of \v - anything except newlines and vertical tabs|
|
||||
|`\h` | Horizontal whitespace character|
|
||||
|`\H` | Negation of \h|
|
||||
|`\K` | Reset match|
|
||||
|`\n` | Match nth subpattern|
|
||||
|`\pX` | Unicode property X|
|
||||
|`\p{...}` | Unicode property or script category|
|
||||
|`\PX` | Negation of \pX|
|
||||
|`\P{...}` | Negation of \p|
|
||||
|`\Q...\E` | Quote; treat as literals|
|
||||
|`\k<name>` | Match subpattern `name`|
|
||||
|`\k'name'` | Match subpattern `name`|
|
||||
|`\k{name}` | Match subpattern `name`|
|
||||
|`\gn` | Match nth subpattern|
|
||||
|`\g{n}` | Match nth subpattern|
|
||||
|`\g<n>` | Recurse nth capture group|
|
||||
|`\g'n'` | Recurses nth capture group.|
|
||||
|`\g{-n}` | Match nth relative previous subpattern|
|
||||
|`\g<+n>` | Recurse nth relative upcoming subpattern|
|
||||
|`\g'+n'` | Match nth relative upcoming subpattern|
|
||||
|`\g'letter'` | Recurse named capture group `letter`|
|
||||
|`\g{letter}` | Match previously-named capture group `letter`|
|
||||
|`\g<letter>` | Recurses named capture group `letter`|
|
||||
|`\xYY` | Hex character YY|
|
||||
|`\x{YYYY}` | Hex character YYYY|
|
||||
|`\ddd` | Octal character ddd|
|
||||
|`\cY` | Control character Y|
|
||||
|`[\b]` | Backspace character|
|
||||
|`\` | Makes any character literal|
|
||||
| Pattern | Description |
|
||||
|--------------|-------------------------------------------------------------|
|
||||
| `.` | Any single character |
|
||||
| `\s` | Any whitespace character |
|
||||
| `\S` | Any non-whitespace character |
|
||||
| `\d` | Any digit, Same as [0-9] |
|
||||
| `\D` | Any non-digit, Same as [^0-9] |
|
||||
| `\w` | Any word character |
|
||||
| `\W` | Any non-word character |
|
||||
| `\X` | Any Unicode sequences, linebreaks included |
|
||||
| `\C` | Match one data unit |
|
||||
| `\R` | Unicode newlines |
|
||||
| `\v` | Vertical whitespace character |
|
||||
| `\V` | Negation of \v - anything except newlines and vertical tabs |
|
||||
| `\h` | Horizontal whitespace character |
|
||||
| `\H` | Negation of \h |
|
||||
| `\K` | Reset match |
|
||||
| `\n` | Match nth subpattern |
|
||||
| `\pX` | Unicode property X |
|
||||
| `\p{...}` | Unicode property or script category |
|
||||
| `\PX` | Negation of \pX |
|
||||
| `\P{...}` | Negation of \p |
|
||||
| `\Q...\E` | Quote; treat as literals |
|
||||
| `\k<name>` | Match subpattern `name` |
|
||||
| `\k'name'` | Match subpattern `name` |
|
||||
| `\k{name}` | Match subpattern `name` |
|
||||
| `\gn` | Match nth subpattern |
|
||||
| `\g{n}` | Match nth subpattern |
|
||||
| `\g<n>` | Recurse nth capture group |
|
||||
| `\g'n'` | Recurses nth capture group. |
|
||||
| `\g{-n}` | Match nth relative previous subpattern |
|
||||
| `\g<+n>` | Recurse nth relative upcoming subpattern |
|
||||
| `\g'+n'` | Match nth relative upcoming subpattern |
|
||||
| `\g'letter'` | Recurse named capture group `letter` |
|
||||
| `\g{letter}` | Match previously-named capture group `letter` |
|
||||
| `\g<letter>` | Recurses named capture group `letter` |
|
||||
| `\xYY` | Hex character YY |
|
||||
| `\x{YYYY}` | Hex character YYYY |
|
||||
| `\ddd` | Octal character ddd |
|
||||
| `\cY` | Control character Y |
|
||||
| `[\b]` | Backspace character |
|
||||
| `\` | Makes any character literal |
|
||||
|
||||
|
||||
|
||||
|
||||
### Anchors
|
||||
|
||||
| Pattern | Description |
|
||||
|------------|--------------------------------------|
|
||||
|`\G` | Start of match|
|
||||
|`^` | Start of string|
|
||||
|`$` | End of string|
|
||||
|`\A` | Start of string|
|
||||
|`\Z` | End of string|
|
||||
|`\z` | Absolute end of string|
|
||||
|`\b` | A word boundary|
|
||||
|`\B` | Non-word boundary|
|
||||
| Pattern | Description |
|
||||
|---------|------------------------|
|
||||
| `\G` | Start of match |
|
||||
| `^` | Start of string |
|
||||
| `$` | End of string |
|
||||
| `\A` | Start of string |
|
||||
| `\Z` | End of string |
|
||||
| `\z` | Absolute end of string |
|
||||
| `\b` | A word boundary |
|
||||
| `\B` | Non-word boundary |
|
||||
|
||||
|
||||
|
||||
|
||||
### Substitution
|
||||
|
||||
| Pattern | Description |
|
||||
|------------|--------------------------------------|
|
||||
|`\0` | Complete match contents|
|
||||
|`\1` | Contents in capture group 1|
|
||||
|`$1` | Contents in capture group 1|
|
||||
|`${foo}` | Contents in capture group `foo`|
|
||||
|`\x20` | Hexadecimal replacement values|
|
||||
|`\x{06fa}` | Hexadecimal replacement values|
|
||||
|`\t` | Tab|
|
||||
|`\r` | Carriage return|
|
||||
|`\n` | Newline|
|
||||
|`\f` | Form-feed|
|
||||
|`\U` | Uppercase Transformation|
|
||||
|`\L` | Lowercase Transformation|
|
||||
|`\E` | Terminate any Transformation|
|
||||
| Pattern | Description |
|
||||
|------------|---------------------------------|
|
||||
| `\0` | Complete match contents |
|
||||
| `\1` | Contents in capture group 1 |
|
||||
| `$1` | Contents in capture group 1 |
|
||||
| `${foo}` | Contents in capture group `foo` |
|
||||
| `\x20` | Hexadecimal replacement values |
|
||||
| `\x{06fa}` | Hexadecimal replacement values |
|
||||
| `\t` | Tab |
|
||||
| `\r` | Carriage return |
|
||||
| `\n` | Newline |
|
||||
| `\f` | Form-feed |
|
||||
| `\U` | Uppercase Transformation |
|
||||
| `\L` | Lowercase Transformation |
|
||||
| `\E` | Terminate any Transformation |
|
||||
|
||||
|
||||
|
||||
|
||||
### Group Constructs
|
||||
|
||||
| Pattern | Description |
|
||||
|------------|--------------------------------------|
|
||||
|`(...)` | Capture everything enclosed|
|
||||
|`(a|b)` | Match either a or b|
|
||||
|`(?:...)` | Match everything enclosed|
|
||||
|`(?>...)` | Atomic group (non-capturing)|
|
||||
|`(?|...)` | Duplicate subpattern group number|
|
||||
|`(?#...)` | Comment|
|
||||
| Pattern | Description |
|
||||
|-----------|-----------------------------------|
|
||||
| `(...)` | Capture everything enclosed |
|
||||
| `(a|b)` | Match either a or b |
|
||||
| `(?:...)` | Match everything enclosed |
|
||||
| `(?>...)` | Atomic group (non-capturing) |
|
||||
| `(?|...)` | Duplicate subpattern group number |
|
||||
| `(?#...)` | Comment |
|
||||
|
||||
|`(?'name'...)` | Named Capturing Group|
|
||||
|`(?<name>...)` | Named Capturing Group|
|
||||
@@ -198,25 +198,25 @@ Escape these special characters with `\`
|
||||
### Assertions
|
||||
|
||||
|
||||
| - | - |
|
||||
|------------|--------------------------------------|
|
||||
|`(?(1)yes|no)` | Conditional statement|
|
||||
|`(?(R)yes|no)` | Conditional statement|
|
||||
|`(?(R#)yes|no)` | Recursive Conditional statement|
|
||||
|`(?(R&name)yes|no)` | Conditional statement|
|
||||
|`(?(?=...)yes|no)` | Lookahead conditional|
|
||||
|`(?(?<=...)yes|no)` | Lookbehind conditional|
|
||||
| - | - |
|
||||
|---------------------|---------------------------------|
|
||||
| `(?(1)yes|no)` | Conditional statement |
|
||||
| `(?(R)yes|no)` | Conditional statement |
|
||||
| `(?(R#)yes|no)` | Recursive Conditional statement |
|
||||
| `(?(R&name)yes|no)` | Conditional statement |
|
||||
| `(?(?=...)yes|no)` | Lookahead conditional |
|
||||
| `(?(?<=...)yes|no)` | Lookbehind conditional |
|
||||
|
||||
|
||||
|
||||
### Lookarounds
|
||||
|
||||
| - | - |
|
||||
|------------|--------------------------------------|
|
||||
|`(?=...)` | Positive Lookahead|
|
||||
|`(?!...)` | Negative Lookahead|
|
||||
|`(?<=...)` | Positive Lookbehind|
|
||||
|`(?<!...)` | Negative Lookbehind|
|
||||
| - | - |
|
||||
|------------|---------------------|
|
||||
| `(?=...)` | Positive Lookahead |
|
||||
| `(?!...)` | Negative Lookahead |
|
||||
| `(?<=...)` | Positive Lookbehind |
|
||||
| `(?<!...)` | Negative Lookbehind |
|
||||
Lookaround lets you match a group before (lookbehind) or after (lookahead) your main pattern without including it in the result.
|
||||
|
||||
|
||||
@@ -224,47 +224,47 @@ Lookaround lets you match a group before (lookbehind) or after (lookahead) your
|
||||
|
||||
### Flags/Modifiers
|
||||
|
||||
| Pattern | Description |
|
||||
|------------|--------------------------------------|
|
||||
|`g` | Global|
|
||||
|`m` | Multiline|
|
||||
|`i` | Case insensitive|
|
||||
|`x` | Ignore whitespace|
|
||||
|`s` | Single line|
|
||||
|`u` | Unicode|
|
||||
|`X` | eXtended|
|
||||
|`U` | Ungreedy|
|
||||
|`A` | Anchor|
|
||||
|`J` | Duplicate group names|
|
||||
| Pattern | Description |
|
||||
|---------|-----------------------|
|
||||
| `g` | Global |
|
||||
| `m` | Multiline |
|
||||
| `i` | Case insensitive |
|
||||
| `x` | Ignore whitespace |
|
||||
| `s` | Single line |
|
||||
| `u` | Unicode |
|
||||
| `X` | eXtended |
|
||||
| `U` | Ungreedy |
|
||||
| `A` | Anchor |
|
||||
| `J` | Duplicate group names |
|
||||
|
||||
|
||||
|
||||
### Recurse
|
||||
|
||||
| - | - |
|
||||
|------------|--------------------------------------|
|
||||
|`(?R)` | Recurse entire pattern|
|
||||
|`(?1)` | Recurse first subpattern|
|
||||
|`(?+1)` | Recurse first relative subpattern|
|
||||
|`(?&name)` | Recurse subpattern `name`|
|
||||
|`(?P=name)` | Match subpattern `name`|
|
||||
|`(?P>name)` | Recurse subpattern `name`|
|
||||
| - | - |
|
||||
|-------------|-----------------------------------|
|
||||
| `(?R)` | Recurse entire pattern |
|
||||
| `(?1)` | Recurse first subpattern |
|
||||
| `(?+1)` | Recurse first relative subpattern |
|
||||
| `(?&name)` | Recurse subpattern `name` |
|
||||
| `(?P=name)` | Match subpattern `name` |
|
||||
| `(?P>name)` | Recurse subpattern `name` |
|
||||
|
||||
|
||||
|
||||
|
||||
### POSIX Character Classes {.col-span-2}
|
||||
| Character Class| Same as | Meaning |
|
||||
|----------------|-------------------------------------------------------------|--------------------------------|
|
||||
| `[[:alnum:]]` | `[0-9A-Za-z]` | Letters and digits |
|
||||
| `[[:alpha:]]` | `[A-Za-z]` | Letters |
|
||||
| `[[:ascii:]]` | `[\x00-\x7F]` | ASCII codes 0-127 |
|
||||
| `[[:blank:]]` | `[\t ]` | Space or tab only |
|
||||
| `[[:cntrl:]]` | `[\x00-\x1F\x7F]` | Control characters |
|
||||
| `[[:digit:]]` | `[0-9]` | Decimal digits |
|
||||
| `[[:graph:]]` | `[[:alnum:][:punct:]]` | Visible characters (not space) |
|
||||
| `[[:lower:]]` | `[a-z]` | Lowercase letters |
|
||||
| `[[:print:]]` | `[ -~] == [ [:graph:]]` | Visible characters |
|
||||
| Character Class | Same as | Meaning |
|
||||
|-----------------|-------------------------|--------------------------------|
|
||||
| `[[:alnum:]]` | `[0-9A-Za-z]` | Letters and digits |
|
||||
| `[[:alpha:]]` | `[A-Za-z]` | Letters |
|
||||
| `[[:ascii:]]` | `[\x00-\x7F]` | ASCII codes 0-127 |
|
||||
| `[[:blank:]]` | `[\t ]` | Space or tab only |
|
||||
| `[[:cntrl:]]` | `[\x00-\x1F\x7F]` | Control characters |
|
||||
| `[[:digit:]]` | `[0-9]` | Decimal digits |
|
||||
| `[[:graph:]]` | `[[:alnum:][:punct:]]` | Visible characters (not space) |
|
||||
| `[[:lower:]]` | `[a-z]` | Lowercase letters |
|
||||
| `[[:print:]]` | `[ -~] == [ [:graph:]]` | Visible characters |
|
||||
| `[[:punct:]]` | <code>[!"#$%&’()*+,-./:;<=>?@[]^_\`{\|}~]</code> | Visible punctuation characters |
|
||||
| `[[:space:]]` | <code>[\t\n\v\f\r ]</code> | Whitespace |
|
||||
| `[[:upper:]]` | `[A-Z]` | Uppercase letters |
|
||||
@@ -280,32 +280,32 @@ Lookaround lets you match a group before (lookbehind) or after (lookahead) your
|
||||
|
||||
### Control verb
|
||||
|
||||
| - | - |
|
||||
|------------|--------------------------------------|
|
||||
|`(*ACCEPT)` | Control verb|
|
||||
|`(*FAIL)` | Control verb|
|
||||
|`(*MARK:NAME)` | Control verb|
|
||||
|`(*COMMIT)` | Control verb|
|
||||
|`(*PRUNE)` | Control verb|
|
||||
|`(*SKIP)` | Control verb|
|
||||
|`(*THEN)` | Control verb|
|
||||
|`(*UTF)` | Pattern modifier|
|
||||
|`(*UTF8)` | Pattern modifier|
|
||||
|`(*UTF16)` | Pattern modifier|
|
||||
|`(*UTF32)` | Pattern modifier|
|
||||
|`(*UCP)` | Pattern modifier|
|
||||
|`(*CR)` | Line break modifier|
|
||||
|`(*LF)` | Line break modifier|
|
||||
|`(*CRLF)` | Line break modifier|
|
||||
|`(*ANYCRLF)` | Line break modifier|
|
||||
|`(*ANY)` | Line break modifier|
|
||||
|`\R` | Line break modifier|
|
||||
|`(*BSR_ANYCRLF)` | Line break modifier|
|
||||
|`(*BSR_UNICODE)` | Line break modifier|
|
||||
|`(*LIMIT_MATCH=x)` | Regex engine modifier|
|
||||
|`(*LIMIT_RECURSION=d)` | Regex engine modifier|
|
||||
|`(*NO_AUTO_POSSESS)` | Regex engine modifier|
|
||||
|`(*NO_START_OPT)` | Regex engine modifier|
|
||||
| - | - |
|
||||
|------------------------|-----------------------|
|
||||
| `(*ACCEPT)` | Control verb |
|
||||
| `(*FAIL)` | Control verb |
|
||||
| `(*MARK:NAME)` | Control verb |
|
||||
| `(*COMMIT)` | Control verb |
|
||||
| `(*PRUNE)` | Control verb |
|
||||
| `(*SKIP)` | Control verb |
|
||||
| `(*THEN)` | Control verb |
|
||||
| `(*UTF)` | Pattern modifier |
|
||||
| `(*UTF8)` | Pattern modifier |
|
||||
| `(*UTF16)` | Pattern modifier |
|
||||
| `(*UTF32)` | Pattern modifier |
|
||||
| `(*UCP)` | Pattern modifier |
|
||||
| `(*CR)` | Line break modifier |
|
||||
| `(*LF)` | Line break modifier |
|
||||
| `(*CRLF)` | Line break modifier |
|
||||
| `(*ANYCRLF)` | Line break modifier |
|
||||
| `(*ANY)` | Line break modifier |
|
||||
| `\R` | Line break modifier |
|
||||
| `(*BSR_ANYCRLF)` | Line break modifier |
|
||||
| `(*BSR_UNICODE)` | Line break modifier |
|
||||
| `(*LIMIT_MATCH=x)` | Regex engine modifier |
|
||||
| `(*LIMIT_RECURSION=d)` | Regex engine modifier |
|
||||
| `(*NO_AUTO_POSSESS)` | Regex engine modifier |
|
||||
| `(*NO_START_OPT)` | Regex engine modifier |
|
||||
|
||||
|
||||
|
||||
@@ -315,105 +315,105 @@ Regex examples{.cols-3}
|
||||
--------------
|
||||
|
||||
### Characters
|
||||
| Pattern | Matches |
|
||||
|---------------|-----------------------------------|
|
||||
| `ring `| Match <yel>ring</yel> sp<yel>ring</yel>board etc. |
|
||||
| `. `| Match <yel>a</yel>, <yel>9</yel>, <yel>+</yel> etc. |
|
||||
| `h.o `| Match <yel>hoo</yel>, <yel>h2o</yel>, <yel>h/o</yel> etc. |
|
||||
| `ring\? `| Match <yel>ring?</yel> |
|
||||
| `\(quiet\) `| Match <yel>(quiet)</yel> |
|
||||
| `c:\\windows `| Match <yel>c:\windows</yel> |
|
||||
| Pattern | Matches |
|
||||
|----------------|------------------------------------------------------------|
|
||||
| `ring ` | Match <yel>ring</yel> sp<yel>ring</yel>board etc. |
|
||||
| `. ` | Match <yel>a</yel>, <yel>9</yel>, <yel>+</yel> etc. |
|
||||
| `h.o ` | Match <yel>hoo</yel>, <yel>h2o</yel>, <yel>h/o</yel> etc. |
|
||||
| `ring\? ` | Match <yel>ring?</yel> |
|
||||
| `\(quiet\) ` | Match <yel>(quiet)</yel> |
|
||||
| `c:\\windows ` | Match <yel>c:\windows</yel> |
|
||||
|
||||
Use `\` to search for these special characters: <br> `[ \ ^ $ . | ? * + ( ) { }`
|
||||
|
||||
|
||||
### Alternatives
|
||||
|
||||
| Pattern | Matches |
|
||||
|----------------|------------------------|
|
||||
| `cat|dog `| Match <yel>cat</yel> or <yel>dog</yel> |
|
||||
| `id|identity `| Match <yel>id</yel> or <yel>id</yel>entity |
|
||||
| `identity|id `| Match <yel>id</yel> or <yel>identity</yel> |
|
||||
| Pattern | Matches |
|
||||
|----------------|--------------------------------------------|
|
||||
| `cat|dog ` | Match <yel>cat</yel> or <yel>dog</yel> |
|
||||
| `id|identity ` | Match <yel>id</yel> or <yel>id</yel>entity |
|
||||
| `identity|id ` | Match <yel>id</yel> or <yel>identity</yel> |
|
||||
|
||||
Order longer to shorter when alternatives overlap
|
||||
|
||||
### Character classes
|
||||
| Pattern | Matches |
|
||||
|---------------|-----------------------------------|
|
||||
| `[aeiou]` | Match any vowel |
|
||||
| `[^aeiou]` | Match a NON vowel |
|
||||
| Pattern | Matches |
|
||||
|---------------|--------------------------------------------------------------------|
|
||||
| `[aeiou]` | Match any vowel |
|
||||
| `[^aeiou]` | Match a NON vowel |
|
||||
| `r[iau]ng` | Match <yel>ring</yel>, w<yel>rang</yel>le, sp<yel>rung</yel>, etc. |
|
||||
| `gr[ae]y` | Match <yel>gray</yel> or <yel>grey</yel> |
|
||||
| `[a-zA-Z0-9]` | Match any letter or digit |
|
||||
| `gr[ae]y` | Match <yel>gray</yel> or <yel>grey</yel> |
|
||||
| `[a-zA-Z0-9]` | Match any letter or digit |
|
||||
|
||||
In `[ ]` always escape `. \ ]` and sometimes `^ - .`
|
||||
|
||||
|
||||
### Shorthand classes
|
||||
| Pattern | Meaning |
|
||||
|------------------|-------------------------------------------------|
|
||||
| Pattern | Meaning |
|
||||
|------------------|-------------------------------------------------------|
|
||||
| `\w ` | "Word" character <br>_(letter, digit, or underscore)_ |
|
||||
| `\d ` | Digit |
|
||||
| `\d ` | Digit |
|
||||
| `\s ` | Whitespace <br>_(space, tab, vtab, newline)_ |
|
||||
| `\W, \D, or \S ` | Not word, digit, or whitespace |
|
||||
| `[\D\S] ` | Means not digit or whitespace, both match |
|
||||
| `[^\d\s] ` | Disallow digit and whitespace |
|
||||
| `\W, \D, or \S ` | Not word, digit, or whitespace |
|
||||
| `[\D\S] ` | Means not digit or whitespace, both match |
|
||||
| `[^\d\s] ` | Disallow digit and whitespace |
|
||||
|
||||
|
||||
### Occurrences
|
||||
| Pattern | Matches |
|
||||
|---------------------|-----------------------------------|
|
||||
| `colou?r` | Match <yel>color</yel> or <yel>colour</yel> |
|
||||
| Pattern | Matches |
|
||||
|---------------------|--------------------------------------------------------------------|
|
||||
| `colou?r` | Match <yel>color</yel> or <yel>colour</yel> |
|
||||
| `[BW]ill[ieamy's]*` | Match <yel>Bill</yel>, <yel>Willy</yel>, <yel>William's</yel> etc. |
|
||||
| `[a-zA-Z]+` | Match 1 or more letters |
|
||||
| `\d{3}-\d{2}-\d{4}` | Match a SSN |
|
||||
| `[a-z]\w{1,7}` | Match a UW NetID |
|
||||
| `[a-zA-Z]+` | Match 1 or more letters |
|
||||
| `\d{3}-\d{2}-\d{4}` | Match a SSN |
|
||||
| `[a-z]\w{1,7}` | Match a UW NetID |
|
||||
|
||||
|
||||
|
||||
### Greedy versus lazy
|
||||
| Pattern | Meaning |
|
||||
|---------------------------|----------------------------------|
|
||||
| `* + {n,}`<br>_greedy_ | Match as much as possible |
|
||||
| `<.+> ` | Finds 1 big match in <yel>\<b>bold\<\/b></yel> |
|
||||
| `*? +? {n,}?`<br>_lazy_ | Match as little as possible |
|
||||
| `<.+?>` | Finds 2 matches in \<<yel>b</yel>>bold\<<yel>\/b</yel>> |
|
||||
| Pattern | Meaning |
|
||||
|--------------------------|---------------------------------------------------------|
|
||||
| `* + {n,}`<br>_greedy_ | Match as much as possible |
|
||||
| `<.+> ` | Finds 1 big match in <yel>\<b>bold\<\/b></yel> |
|
||||
| `*? +? {n,}?`<br>_lazy_ | Match as little as possible |
|
||||
| `<.+?>` | Finds 2 matches in \<<yel>b</yel>>bold\<<yel>\/b</yel>> |
|
||||
|
||||
|
||||
### Scope {.col-span-2}
|
||||
| Pattern | Meaning |
|
||||
|--------------------|---------------------------------------------|
|
||||
| `\b ` | "Word" edge (next to non "word" character) |
|
||||
| `\bring ` | Word starts with "ring", ex <yel>ringtone</yel> |
|
||||
| `ring\b ` | Word ends with "ring", ex <yel>spring</yel> |
|
||||
| Pattern | Meaning |
|
||||
|--------------------|--------------------------------------------------------|
|
||||
| `\b ` | "Word" edge (next to non "word" character) |
|
||||
| `\bring ` | Word starts with "ring", ex <yel>ringtone</yel> |
|
||||
| `ring\b ` | Word ends with "ring", ex <yel>spring</yel> |
|
||||
| `\b9\b ` | Match single digit <yel>9</yel>, not 19, 91, 99, etc.. |
|
||||
| `\b[a-zA-Z]{6}\b ` | Match 6-letter words |
|
||||
| `\B ` | Not word edge |
|
||||
| `\Bring\B ` | Match <yel>springs</yel> and <yel>wringer</yel> |
|
||||
| `^\d*$ ` | Entire string must be digits |
|
||||
| `^[a-zA-Z]{4,20}$` | String must have 4-20 letters |
|
||||
| `^[A-Z] ` | String must begin with capital letter |
|
||||
| `[\.!?"')]$ ` | String must end with terminal puncutation |
|
||||
| `\b[a-zA-Z]{6}\b ` | Match 6-letter words |
|
||||
| `\B ` | Not word edge |
|
||||
| `\Bring\B ` | Match <yel>springs</yel> and <yel>wringer</yel> |
|
||||
| `^\d*$ ` | Entire string must be digits |
|
||||
| `^[a-zA-Z]{4,20}$` | String must have 4-20 letters |
|
||||
| `^[A-Z] ` | String must begin with capital letter |
|
||||
| `[\.!?"')]$ ` | String must end with terminal puncutation |
|
||||
|
||||
|
||||
|
||||
### Modifiers
|
||||
| Pattern | Meaning |
|
||||
|-------------------|--------------------------------------------------|
|
||||
| `(?i)`[a-z]*`(?-i)` | Ignore case ON / OFF |
|
||||
| `(?s)`.*`(?-s)` | Match multiple lines (causes . to match newline) |
|
||||
| `(?m)`^.*;$`(?-m)` | <yel>^</yel> & <yel>$</yel> match lines not whole string |
|
||||
| `(?x)` | #free-spacing mode, this EOL comment ignored |
|
||||
| `(?-x)` | free-spacing mode OFF |
|
||||
| /regex/`ismx` | Modify mode for entire string |
|
||||
| Pattern | Meaning |
|
||||
|---------------------|----------------------------------------------------------|
|
||||
| `(?i)`[a-z]*`(?-i)` | Ignore case ON / OFF |
|
||||
| `(?s)`.*`(?-s)` | Match multiple lines (causes . to match newline) |
|
||||
| `(?m)`^.*;$`(?-m)` | <yel>^</yel> & <yel>$</yel> match lines not whole string |
|
||||
| `(?x)` | #free-spacing mode, this EOL comment ignored |
|
||||
| `(?-x)` | free-spacing mode OFF |
|
||||
| /regex/`ismx` | Modify mode for entire string |
|
||||
|
||||
|
||||
|
||||
### Groups
|
||||
| Pattern | Meaning |
|
||||
|------------------|------------------------------|
|
||||
| Pattern | Meaning |
|
||||
|------------------|---------------------------------------------|
|
||||
| `(in\|out)put ` | Match <yel>input</yel> or <yel>output</yel> |
|
||||
| `\d{5}(-\d{4})?` | US zip code _("+ 4" optional)_ |
|
||||
| `\d{5}(-\d{4})?` | US zip code _("+ 4" optional)_ |
|
||||
Parser tries EACH alternative if match fails after group.
|
||||
<br>
|
||||
Can lead to catastrophic backtracking.
|
||||
@@ -422,17 +422,17 @@ Can lead to catastrophic backtracking.
|
||||
|
||||
|
||||
### Back references
|
||||
| Pattern | Matches |
|
||||
|--------------------------|--------------------------------------------------|
|
||||
| `(to) (be) or not \1 \2` | Match <yel>to be or not to be</yel> |
|
||||
| Pattern | Matches |
|
||||
|--------------------------|-----------------------------------------------------------------------------|
|
||||
| `(to) (be) or not \1 \2` | Match <yel>to be or not to be</yel> |
|
||||
| `([^\s])\1{2}` | Match non-space, then same twice more <yel>aaa</yel>, <yel>...</yel> |
|
||||
| `\b(\w+)\s+\1\b` | Match doubled words |
|
||||
| `\b(\w+)\s+\1\b` | Match doubled words |
|
||||
|
||||
|
||||
|
||||
### Non-capturing group
|
||||
| Pattern | Meaning |
|
||||
|---------------------|-----------------------------|
|
||||
| Pattern | Meaning |
|
||||
|---------------------|------------------------------------|
|
||||
| `on(?:click\|load)` | Faster than: <br>`on(click\|load)` |
|
||||
|
||||
Use non-capturing or atomic groups when possible
|
||||
@@ -440,9 +440,9 @@ Use non-capturing or atomic groups when possible
|
||||
|
||||
|
||||
### Atomic groups
|
||||
| Pattern | Meaning |
|
||||
|------------------------|----------------------------|
|
||||
| `(?>red\|green\|blue)` | Faster than non-capturing |
|
||||
| Pattern | Meaning |
|
||||
|------------------------|--------------------------------------------------|
|
||||
| `(?>red\|green\|blue)` | Faster than non-capturing |
|
||||
| `(?>id\|identity)\b` | Match <yel>id</yel>, but not <yel>id</yel>entity |
|
||||
|
||||
"id" matches, but `\b` fails after atomic group,
|
||||
@@ -454,17 +454,17 @@ If alternatives overlap, order longer to shorter.
|
||||
|
||||
|
||||
### Lookaround {.row-span-2 .col-span-2}
|
||||
| Pattern | Meaning |
|
||||
|-------------------------|--------------------------------------|
|
||||
| `(?= )` | Lookahead, if you can find ahead |
|
||||
| `(?! )` | Lookahead,if you can not find ahead |
|
||||
| `(?<= )` | Lookbehind, if you can find behind |
|
||||
| `(?<! )` | Lookbehind, if you can NOT find behind |
|
||||
| Pattern | Meaning |
|
||||
|-------------------------|-----------------------------------------------------------------------|
|
||||
| `(?= )` | Lookahead, if you can find ahead |
|
||||
| `(?! )` | Lookahead,if you can not find ahead |
|
||||
| `(?<= )` | Lookbehind, if you can find behind |
|
||||
| `(?<! )` | Lookbehind, if you can NOT find behind |
|
||||
| `\b\w+?(?=ing\b)` | Match <yel>warbl</yel>ing, <yel>str</yel>ing, <yel>fish</yel>ing, ... |
|
||||
| `\b(?!\w+ing\b)\w+\b` | Words NOT ending in "ing" |
|
||||
| `\b(?!\w+ing\b)\w+\b` | Words NOT ending in "ing" |
|
||||
| `(?<=\bpre).*?\b ` | Match pre<yel>tend</yel>, pre<yel>sent</yel>, pre<yel>fix</yel>, ... |
|
||||
| `\b\w{3}(?<!pre)\w*?\b` | Words NOT starting with "pre" |
|
||||
| `\b\w+(?<!ing)\b` | Match words NOT ending in "ing" |
|
||||
| `\b\w{3}(?<!pre)\w*?\b` | Words NOT starting with "pre" |
|
||||
| `\b\w+(?<!ing)\b` | Match words NOT ending in "ing" |
|
||||
|
||||
|
||||
### If-then-else
|
||||
@@ -545,29 +545,29 @@ False
|
||||
|
||||
### Functions
|
||||
|
||||
| Function | Description |
|
||||
|----------|-------------------------------------------------------------------|
|
||||
| Function | Description |
|
||||
|---------------|-------------------------------------------------------------------|
|
||||
| `re.findall` | Returns a list containing all matches |
|
||||
| `re.finditer` | Return an iterable of match objects (one for each match) |
|
||||
| `re.finditer` | Return an iterable of match objects (one for each match) |
|
||||
| `re.search` | Returns a Match object if there is a match anywhere in the string |
|
||||
| `re.split` | Returns a list where the string has been split at each match |
|
||||
| `re.sub` | Replaces one or many matches with a string |
|
||||
| `re.compile` | Compile a regular expression pattern for later use |
|
||||
| `re.escape` | Return string with all non-alphanumerics backslashed |
|
||||
| `re.compile` | Compile a regular expression pattern for later use |
|
||||
| `re.escape` | Return string with all non-alphanumerics backslashed |
|
||||
|
||||
|
||||
|
||||
### Flags
|
||||
|
||||
|
||||
| - | - | - |
|
||||
|--------|-----------------|-------------------------------------------|
|
||||
| `re.I` | `re.IGNORECASE` | Ignore case |
|
||||
| `re.M` | `re.MULTILINE` | Multiline |
|
||||
| `re.L` | `re.LOCALE` | Make `\w`,`\b`,`\s` _locale dependent_ |
|
||||
| `re.S` | `re.DOTALL` | Dot matches all _(including newline)_ |
|
||||
| - | - | - |
|
||||
|--------|-----------------|----------------------------------------------|
|
||||
| `re.I` | `re.IGNORECASE` | Ignore case |
|
||||
| `re.M` | `re.MULTILINE` | Multiline |
|
||||
| `re.L` | `re.LOCALE` | Make `\w`,`\b`,`\s` _locale dependent_ |
|
||||
| `re.S` | `re.DOTALL` | Dot matches all _(including newline)_ |
|
||||
| `re.U` | `re.UNICODE` | Make `\w`,`\b`,`\d`,`\s` _unicode dependent_ |
|
||||
| `re.X` | `re.VERBOSE` | Readable style |
|
||||
| `re.X` | `re.VERBOSE` | Readable style |
|
||||
|
||||
|
||||
|
||||
@@ -688,7 +688,7 @@ Regex in PHP {.cols-3}
|
||||
### Functions {.col-span-2}
|
||||
|
||||
|
||||
| - | - |
|
||||
| - | - |
|
||||
|---------------------------|------------------------------------------------------------------|
|
||||
| `preg_match()` | Performs a regex match |
|
||||
| `preg_match_all()` | Perform a global regular expression match |
|
||||
@@ -793,15 +793,15 @@ System.out.println(s3); // Outputs: false
|
||||
### Pattern Fields
|
||||
|
||||
|
||||
| - | - |
|
||||
|----------------------|-----------------------------------------------|
|
||||
| `CANON_EQ` | Canonical equivalence |
|
||||
| `CASE_INSENSITIVE` | Case-insensitive matching |
|
||||
| `COMMENTS` | Permits whitespace and comments |
|
||||
| `DOTALL` | Dotall mode |
|
||||
| `MULTILINE` | Multiline mode |
|
||||
| `UNICODE_CASE` | Unicode-aware case folding |
|
||||
| `UNIX_LINES` | Unix lines mode |
|
||||
| - | - |
|
||||
|--------------------|---------------------------------|
|
||||
| `CANON_EQ` | Canonical equivalence |
|
||||
| `CASE_INSENSITIVE` | Case-insensitive matching |
|
||||
| `COMMENTS` | Permits whitespace and comments |
|
||||
| `DOTALL` | Dotall mode |
|
||||
| `MULTILINE` | Multiline mode |
|
||||
| `UNICODE_CASE` | Unicode-aware case folding |
|
||||
| `UNIX_LINES` | Unix lines mode |
|
||||
|
||||
|
||||
|
||||
@@ -869,12 +869,12 @@ Regex in MySQL {.cols-2}
|
||||
-------------
|
||||
|
||||
### Functions
|
||||
| Name | Description |
|
||||
|--------------------|---------------------------------------------------------|
|
||||
| `REGEXP ` | Whether string matches regex |
|
||||
| Name | Description |
|
||||
|--------------------|--------------------------------------------------------------------------|
|
||||
| `REGEXP ` | Whether string matches regex |
|
||||
| `REGEXP_INSTR() ` | Starting index of substring matching regex <br>_(NOTE: Only MySQL 8.0+)_ |
|
||||
| `REGEXP_LIKE() ` | Whether string matches regex <br>_(NOTE: Only MySQL 8.0+)_ |
|
||||
| `REGEXP_REPLACE()` | Replace substrings matching regex <br>_(NOTE: Only MySQL 8.0+)_ |
|
||||
| `REGEXP_LIKE() ` | Whether string matches regex <br>_(NOTE: Only MySQL 8.0+)_ |
|
||||
| `REGEXP_REPLACE()` | Replace substrings matching regex <br>_(NOTE: Only MySQL 8.0+)_ |
|
||||
| `REGEXP_SUBSTR() ` | Return substring matching regex <br>_(NOTE: Only MySQL 8.0+)_ |
|
||||
|
||||
|
||||
|
||||
+64
-64
@@ -16,7 +16,7 @@ Resolutions
|
||||
|
||||
### Mobile Phones
|
||||
|
||||
| DEVICES | SCREEN SIZE | RESOLUTION | VIEWPORT | DENSITY | DEVICE DENSITY | RATIO | OS |
|
||||
| DEVICES | SCREEN SIZE | RESOLUTION | VIEWPORT | DENSITY | DEVICE DENSITY | RATIO | OS |
|
||||
|------------------------------------|----------------------|---------------------------|--------------------------|--------------------|--------------------|-------------------------|---------------|
|
||||
| Apple iPhone 11 (2019) | 6.1 <sub>inch</sub> | 828 x 1792 <sub>px</sub> | 414 x 896 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iOS 13.0 |
|
||||
| Apple iPhone 11 Pro (2019) | 5.8 <sub>inch</sub> | 1125 x 2436 <sub>px</sub> | 375 x 812 <sub>px</sub> | 458 <sub>ppi</sub> | 153 <sub>ppi</sub> | 3 <sub>xxhdpi</sub> | iOS 13.0 |
|
||||
@@ -134,79 +134,79 @@ Resolutions
|
||||
|
||||
| DEVICES | SCREEN SIZE | RESOLUTION | VIEWPORT | DENSITY | DEVICE DENSITY | RATIO | OS |
|
||||
|-----------------------------|----------------------|---------------------------|---------------------------|--------------------|--------------------|----------------------|----------------|
|
||||
| Apple iPad 10.2" (2019) | 10.2 <sub>inch</sub> | 1620 x 2160 <sub>px</sub> | 810 x 1080 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.1.2 |
|
||||
| Apple iPad 10.2" (2020) | 10.2 <sub>inch</sub> | 1620 x 2160 <sub>px</sub> | 810 x 1080 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 14 |
|
||||
| Apple iPad Air | 9.7 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 7 |
|
||||
| Apple iPad Air 10.5" (2019) | 10.5 <sub>inch</sub> | 1668 x 2224 <sub>px</sub> | 834 x 1112 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.1.2 |
|
||||
| Apple iPad Air 10.9" (2020) | 10.9 <sub>inch</sub> | 1640 x 2360 <sub>px</sub> | 820 x 1180 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 14 |
|
||||
| Apple iPad Air 2 | 9.7 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 8.1 |
|
||||
| Apple iPad Mini 7.9" (2019) | 7.9 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 324 <sub>ppi</sub> | 162 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.1.2 |
|
||||
| Apple iPad Pro | 12.9 <sub>inch</sub> | 2048 x 2732 <sub>px</sub> | 1024 x 1366 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 9 |
|
||||
| Apple iPad Pro 10.5 (2017) | 10.5 <sub>inch</sub> | 1668 x 2224 <sub>px</sub> | 834 x 1112 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 11 |
|
||||
| Apple iPad Pro 11" (2018) | 11 <sub>inch</sub> | 1668 x 2388 <sub>px</sub> | 834 x 1194 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.1.2 |
|
||||
| Apple iPad Pro 11" (2020) | 11 <sub>inch</sub> | 1668 x 2388 <sub>px</sub> | 834 x 1194 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.4 |
|
||||
| Apple iPad Pro 12.9" (2018) | 12.9 <sub>inch</sub> | 2048 x 2732 <sub>px</sub> | 1024 x 1366 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.1.2 |
|
||||
| Apple iPad Pro 12.9" (2020) | 12.9 <sub>inch</sub> | 2048 x 2732 <sub>px</sub> | 1024 x 1366 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.4 |
|
||||
| Apple iPad Pro 9.7 | 9.7 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 9.3.2 |
|
||||
| Apple iPad Pro 9.7 (2017) | 9.7 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 10.3 |
|
||||
| Apple iPad mini 3 | 7.9 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 324 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 9 |
|
||||
| Apple iPad mini 4 | 7.9 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 324 <sub>ppi</sub> | 162 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 8.1 |
|
||||
| Google Pixel C (2015) | 10.2 <sub>inch</sub> | 2560x1800 <sub>px</sub> | 1280 x 900 <sub>px</sub> | 308 <sub>ppi</sub> | 154 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | Android 6.0.1 |
|
||||
| Apple iPad 10.2" (2019) | 10.2 <sub>inch</sub> | 1620 x 2160 <sub>px</sub> | 810 x 1080 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.1.2 |
|
||||
| Apple iPad 10.2" (2020) | 10.2 <sub>inch</sub> | 1620 x 2160 <sub>px</sub> | 810 x 1080 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 14 |
|
||||
| Apple iPad Air | 9.7 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 7 |
|
||||
| Apple iPad Air 10.5" (2019) | 10.5 <sub>inch</sub> | 1668 x 2224 <sub>px</sub> | 834 x 1112 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.1.2 |
|
||||
| Apple iPad Air 10.9" (2020) | 10.9 <sub>inch</sub> | 1640 x 2360 <sub>px</sub> | 820 x 1180 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 14 |
|
||||
| Apple iPad Air 2 | 9.7 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 8.1 |
|
||||
| Apple iPad Mini 7.9" (2019) | 7.9 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 324 <sub>ppi</sub> | 162 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.1.2 |
|
||||
| Apple iPad Pro | 12.9 <sub>inch</sub> | 2048 x 2732 <sub>px</sub> | 1024 x 1366 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 9 |
|
||||
| Apple iPad Pro 10.5 (2017) | 10.5 <sub>inch</sub> | 1668 x 2224 <sub>px</sub> | 834 x 1112 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 11 |
|
||||
| Apple iPad Pro 11" (2018) | 11 <sub>inch</sub> | 1668 x 2388 <sub>px</sub> | 834 x 1194 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.1.2 |
|
||||
| Apple iPad Pro 11" (2020) | 11 <sub>inch</sub> | 1668 x 2388 <sub>px</sub> | 834 x 1194 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.4 |
|
||||
| Apple iPad Pro 12.9" (2018) | 12.9 <sub>inch</sub> | 2048 x 2732 <sub>px</sub> | 1024 x 1366 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.1.2 |
|
||||
| Apple iPad Pro 12.9" (2020) | 12.9 <sub>inch</sub> | 2048 x 2732 <sub>px</sub> | 1024 x 1366 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | iPadOS 13.4 |
|
||||
| Apple iPad Pro 9.7 | 9.7 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 9.3.2 |
|
||||
| Apple iPad Pro 9.7 (2017) | 9.7 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 264 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 10.3 |
|
||||
| Apple iPad mini 3 | 7.9 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 324 <sub>ppi</sub> | 132 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 9 |
|
||||
| Apple iPad mini 4 | 7.9 <sub>inch</sub> | 1536 x 2048 <sub>px</sub> | 768 x 1024 <sub>px</sub> | 324 <sub>ppi</sub> | 162 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | iOS 8.1 |
|
||||
| Google Pixel C (2015) | 10.2 <sub>inch</sub> | 2560x1800 <sub>px</sub> | 1280 x 900 <sub>px</sub> | 308 <sub>ppi</sub> | 154 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | Android 6.0.1 |
|
||||
{.show-header}
|
||||
|
||||
|
||||
### Laptops
|
||||
|
||||
| DEVICES | SCREEN SIZE | RESOLUTION | VIEWPORT | DENSITY | DEVICE DENSITY | RATIO | OS |
|
||||
|-----------------------|----------------------|---------------------------|--------------------------|--------------------|--------------------|----------------------|-----------------|
|
||||
| MacBook 2015 12" | 12 <sub>inch</sub> | 2304 x 1440 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 226 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook 2016 12" | 12 <sub>inch</sub> | 2304 x 1440 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 226 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook 2017 12" | 12 <sub>inch</sub> | 2304 x 1440 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 226 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Air 2014 11" | 11.6 <sub>inch</sub> | 1366 x 768 <sub>px</sub> | 1366 x 768 <sub>px</sub> | 135 <sub>ppi</sub> | 135 <sub>ppi</sub> | 1.0 <sub>mdpi</sub> | OS X Mavericks |
|
||||
| MacBook Air 2014 13" | 13.3 <sub>inch</sub> | 1440 x 900 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 128 <sub>ppi</sub> | 128 <sub>ppi</sub> | 1.0 <sub>mdpi</sub> | OS X Mavericks |
|
||||
| MacBook Air 2015 11" | 11.6 <sub>inch</sub> | 1366 x 768 <sub>px</sub> | 1366 x 768 <sub>px</sub> | 135 <sub>ppi</sub> | 135 <sub>ppi</sub> | 1.0 <sub>mdpi</sub> | OS X El Capitan |
|
||||
| MacBook Air 2015 13" | 13.3 <sub>inch</sub> | 1440 x 900 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 128 <sub>ppi</sub> | 128 <sub>ppi</sub> | 1.0 <sub>mdpi</sub> | macOS Sierra |
|
||||
| MacBook Air 2017 13" | 13.3 <sub>inch</sub> | 1440 x 900 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 128 <sub>ppi</sub> | 128 <sub>ppi</sub> | 1.0 <sub>mdpi</sub> | macOS Mojave |
|
||||
| MacBook Air 2018 13" | 13.3 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Mojave |
|
||||
| MacBook Air 2020 13" | 13.3 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 114 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | macOS Catalina |
|
||||
| MacBook Pro 13" 2018 | 13.3 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Mojave |
|
||||
| MacBook Pro 15" 2018 | 15.4 <sub>inch</sub> | 2880 x 1800 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 220 <sub>ppi</sub> | 112 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Mojave |
|
||||
| MacBook Pro 16" 2019 | 16 <sub>inch</sub> | 3072 x 1920 <sub>px</sub> | 1536 x 960 <sub>px</sub> | 226 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Catalina |
|
||||
| MacBook Pro 2014 13" | 13.4 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2014 15" | 15.4 <sub>inch</sub> | 2880 x 1800 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 220 <sub>ppi</sub> | 112 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2015 13" | 13.4 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2015 15" | 15.4 <sub>inch</sub> | 2880 x 1800 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 220 <sub>ppi</sub> | 112 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2016 13" | 13.4 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2016 15" | 15.4 <sub>inch</sub> | 2880 x 1800 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 220 <sub>ppi</sub> | 112 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2017 13" | 13.4 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2017 15" | 15.4 <sub>inch</sub> | 2880 x 1800 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 220 <sub>ppi</sub> | 112 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| DEVICES | SCREEN SIZE | RESOLUTION | VIEWPORT | DENSITY | DEVICE DENSITY | RATIO | OS |
|
||||
|----------------------|----------------------|---------------------------|--------------------------|--------------------|--------------------|----------------------|-----------------|
|
||||
| MacBook 2015 12" | 12 <sub>inch</sub> | 2304 x 1440 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 226 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook 2016 12" | 12 <sub>inch</sub> | 2304 x 1440 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 226 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook 2017 12" | 12 <sub>inch</sub> | 2304 x 1440 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 226 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Air 2014 11" | 11.6 <sub>inch</sub> | 1366 x 768 <sub>px</sub> | 1366 x 768 <sub>px</sub> | 135 <sub>ppi</sub> | 135 <sub>ppi</sub> | 1.0 <sub>mdpi</sub> | OS X Mavericks |
|
||||
| MacBook Air 2014 13" | 13.3 <sub>inch</sub> | 1440 x 900 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 128 <sub>ppi</sub> | 128 <sub>ppi</sub> | 1.0 <sub>mdpi</sub> | OS X Mavericks |
|
||||
| MacBook Air 2015 11" | 11.6 <sub>inch</sub> | 1366 x 768 <sub>px</sub> | 1366 x 768 <sub>px</sub> | 135 <sub>ppi</sub> | 135 <sub>ppi</sub> | 1.0 <sub>mdpi</sub> | OS X El Capitan |
|
||||
| MacBook Air 2015 13" | 13.3 <sub>inch</sub> | 1440 x 900 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 128 <sub>ppi</sub> | 128 <sub>ppi</sub> | 1.0 <sub>mdpi</sub> | macOS Sierra |
|
||||
| MacBook Air 2017 13" | 13.3 <sub>inch</sub> | 1440 x 900 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 128 <sub>ppi</sub> | 128 <sub>ppi</sub> | 1.0 <sub>mdpi</sub> | macOS Mojave |
|
||||
| MacBook Air 2018 13" | 13.3 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Mojave |
|
||||
| MacBook Air 2020 13" | 13.3 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 114 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | macOS Catalina |
|
||||
| MacBook Pro 13" 2018 | 13.3 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Mojave |
|
||||
| MacBook Pro 15" 2018 | 15.4 <sub>inch</sub> | 2880 x 1800 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 220 <sub>ppi</sub> | 112 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Mojave |
|
||||
| MacBook Pro 16" 2019 | 16 <sub>inch</sub> | 3072 x 1920 <sub>px</sub> | 1536 x 960 <sub>px</sub> | 226 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Catalina |
|
||||
| MacBook Pro 2014 13" | 13.4 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2014 15" | 15.4 <sub>inch</sub> | 2880 x 1800 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 220 <sub>ppi</sub> | 112 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2015 13" | 13.4 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2015 15" | 15.4 <sub>inch</sub> | 2880 x 1800 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 220 <sub>ppi</sub> | 112 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2016 13" | 13.4 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2016 15" | 15.4 <sub>inch</sub> | 2880 x 1800 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 220 <sub>ppi</sub> | 112 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2017 13" | 13.4 <sub>inch</sub> | 2560 x 1600 <sub>px</sub> | 1280 x 800 <sub>px</sub> | 227 <sub>ppi</sub> | 113 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
| MacBook Pro 2017 15" | 15.4 <sub>inch</sub> | 2880 x 1800 <sub>px</sub> | 1440 x 900 <sub>px</sub> | 220 <sub>ppi</sub> | 112 <sub>ppi</sub> | 2.0 <sub>xhdpi</sub> | macOS Sierra |
|
||||
{.show-header}
|
||||
|
||||
|
||||
### Smart Watch
|
||||
|
||||
| DEVICES | SCREEN SIZE | RESOLUTION | VIEWPORT | DENSITY | DEVICE DENSITY | RATIO | OS |
|
||||
|-------------------------------------|----------------------|-------------------------|-------------------------|--------------------|--------------------|---------------------|-----------------------------|
|
||||
| Apple Watch SE (40mm) (2020) | 1.57 <sub>inch</sub> | 394 x 324 <sub>px</sub> | 197 x 162 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 7.0 |
|
||||
| Apple Watch SE (44mm) (2020) | 1.78 <sub>inch</sub> | 448 x 368 <sub>px</sub> | 224 x 184 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 7.0 |
|
||||
| Apple Watch Series 3 (38mm) | 1.5 <sub>inch</sub> | 340 x 272 <sub>px</sub> | 170 x 136 <sub>px</sub> | 290 <sub>ppi</sub> | 145 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 4.0 |
|
||||
| Apple Watch Series 3 (42mm) | 1.65 <sub>inch</sub> | 390 x 312 <sub>px</sub> | 195 x 156 <sub>px</sub> | 303 <sub>ppi</sub> | 152 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 4.0 |
|
||||
| Apple Watch Series 4 (40mm) | 1.57 <sub>inch</sub> | 394 x 324 <sub>px</sub> | 197 x 162 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 5.0 |
|
||||
| Apple Watch Series 4 (44mm) | 1.78 <sub>inch</sub> | 448 x 368 <sub>px</sub> | 224 x 184 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 5.0 |
|
||||
| Apple Watch Series 5 (40mm) (2019) | 1.57 <sub>inch</sub> | 394 x 324 <sub>px</sub> | 197 x 162 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 6.0 |
|
||||
| Apple Watch Series 5 (44mm) (2019) | 1.78 <sub>inch</sub> | 448 x 368 <sub>px</sub> | 224 x 184 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 6.0 |
|
||||
| Apple Watch Series 6 (40mm) (2020) | 1.57 <sub>inch</sub> | 394 x 324 <sub>px</sub> | 197 x 162 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 7.0 |
|
||||
| Apple Watch Series 6 (44mm) (2020) | 1.78 <sub>inch</sub> | 448 x 368 <sub>px</sub> | 224 x 184 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 7.0 |
|
||||
| Asus Zenwatch 2 (2015) | 1.63 <sub>inch</sub> | 320 x 320 <sub>px</sub> | 213 x 213 <sub>px</sub> | 278 <sub>ppi</sub> | 185 <sub>ppi</sub> | 1.5 <sub>hdpi</sub> | |
|
||||
| Asus Zenwatch 3 (2016) | 1.39 <sub>inch</sub> | 400 x 400 <sub>px</sub> | 267 x 267 <sub>px</sub> | 287 <sub>ppi</sub> | 191 <sub>ppi</sub> | 1.5 <sub>hdpi</sub> | Android Wear OS 2.1 |
|
||||
| Asus Zenwatch 3 (2016) | 1.39 <sub>inch</sub> | 400 x 400 <sub>px</sub> | 267 x 267 <sub>px</sub> | 287 <sub>ppi</sub> | 191 <sub>ppi</sub> | 1.5 <sub>hdpi</sub> | Android Wear OS 2.1 |
|
||||
| Huawei Watch GT (2018) | 1.39 <sub>inch</sub> | 454 x 454 <sub>px</sub> | 227 x 227 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | |
|
||||
| Huawei Watch Magic (2018) | 1.2 <sub>inch</sub> | 390 x 390 <sub>px</sub> | 195 x 195 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | |
|
||||
| LG G Watch R (2015) | 1.3 <sub>inch</sub> | 320 x 320 <sub>px</sub> | 213 x 213 <sub>px</sub> | 245 <sub>ppi</sub> | 163 <sub>ppi</sub> | 1.5 <sub>hdpi</sub> | Android Wear OS 1.0 |
|
||||
| LG Watch Sport (2017) | 1.38 <sub>inch</sub> | 480 x 480 <sub>px</sub> | 240 x 240 <sub>px</sub> | 348 <sub>ppi</sub> | 174 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | Android Wear 2.0 |
|
||||
| LG Watch Urbane 2nd Edition (2016) | 1.38 <sub>inch</sub> | 480 x 480 <sub>px</sub> | 240 x 240 <sub>px</sub> | 348 <sub>ppi</sub> | 174 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | Android Wear 2.0 |
|
||||
| LG Watch W7 (2018) | 1.2 <sub>inch</sub> | 360 x 360 <sub>px</sub> | 240 x 240 <sub>px</sub> | 300 <sub>ppi</sub> | 200 <sub>ppi</sub> | 1.5 <sub>hdpi</sub> | Android Wear OS 2.0 |
|
||||
| Samsung Galaxy Watch (2018) | 1.3 <sub>inch</sub> | 360 x 360 <sub>px</sub> | 240 x 240 <sub>px</sub> | 278 <sub>ppi</sub> | 185 <sub>ppi</sub> | 1.5 <sub>hdpi</sub> | Tizen-based <br/>wearable OS 4.0 |
|
||||
| DEVICES | SCREEN SIZE | RESOLUTION | VIEWPORT | DENSITY | DEVICE DENSITY | RATIO | OS |
|
||||
|-------------------------------------|----------------------|-------------------------|-------------------------|--------------------|--------------------|---------------------|----------------------------------|
|
||||
| Apple Watch SE (40mm) (2020) | 1.57 <sub>inch</sub> | 394 x 324 <sub>px</sub> | 197 x 162 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 7.0 |
|
||||
| Apple Watch SE (44mm) (2020) | 1.78 <sub>inch</sub> | 448 x 368 <sub>px</sub> | 224 x 184 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 7.0 |
|
||||
| Apple Watch Series 3 (38mm) | 1.5 <sub>inch</sub> | 340 x 272 <sub>px</sub> | 170 x 136 <sub>px</sub> | 290 <sub>ppi</sub> | 145 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 4.0 |
|
||||
| Apple Watch Series 3 (42mm) | 1.65 <sub>inch</sub> | 390 x 312 <sub>px</sub> | 195 x 156 <sub>px</sub> | 303 <sub>ppi</sub> | 152 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 4.0 |
|
||||
| Apple Watch Series 4 (40mm) | 1.57 <sub>inch</sub> | 394 x 324 <sub>px</sub> | 197 x 162 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 5.0 |
|
||||
| Apple Watch Series 4 (44mm) | 1.78 <sub>inch</sub> | 448 x 368 <sub>px</sub> | 224 x 184 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 5.0 |
|
||||
| Apple Watch Series 5 (40mm) (2019) | 1.57 <sub>inch</sub> | 394 x 324 <sub>px</sub> | 197 x 162 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 6.0 |
|
||||
| Apple Watch Series 5 (44mm) (2019) | 1.78 <sub>inch</sub> | 448 x 368 <sub>px</sub> | 224 x 184 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 6.0 |
|
||||
| Apple Watch Series 6 (40mm) (2020) | 1.57 <sub>inch</sub> | 394 x 324 <sub>px</sub> | 197 x 162 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 7.0 |
|
||||
| Apple Watch Series 6 (44mm) (2020) | 1.78 <sub>inch</sub> | 448 x 368 <sub>px</sub> | 224 x 184 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | watchOS 7.0 |
|
||||
| Asus Zenwatch 2 (2015) | 1.63 <sub>inch</sub> | 320 x 320 <sub>px</sub> | 213 x 213 <sub>px</sub> | 278 <sub>ppi</sub> | 185 <sub>ppi</sub> | 1.5 <sub>hdpi</sub> | |
|
||||
| Asus Zenwatch 3 (2016) | 1.39 <sub>inch</sub> | 400 x 400 <sub>px</sub> | 267 x 267 <sub>px</sub> | 287 <sub>ppi</sub> | 191 <sub>ppi</sub> | 1.5 <sub>hdpi</sub> | Android Wear OS 2.1 |
|
||||
| Asus Zenwatch 3 (2016) | 1.39 <sub>inch</sub> | 400 x 400 <sub>px</sub> | 267 x 267 <sub>px</sub> | 287 <sub>ppi</sub> | 191 <sub>ppi</sub> | 1.5 <sub>hdpi</sub> | Android Wear OS 2.1 |
|
||||
| Huawei Watch GT (2018) | 1.39 <sub>inch</sub> | 454 x 454 <sub>px</sub> | 227 x 227 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | |
|
||||
| Huawei Watch Magic (2018) | 1.2 <sub>inch</sub> | 390 x 390 <sub>px</sub> | 195 x 195 <sub>px</sub> | 326 <sub>ppi</sub> | 163 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | |
|
||||
| LG G Watch R (2015) | 1.3 <sub>inch</sub> | 320 x 320 <sub>px</sub> | 213 x 213 <sub>px</sub> | 245 <sub>ppi</sub> | 163 <sub>ppi</sub> | 1.5 <sub>hdpi</sub> | Android Wear OS 1.0 |
|
||||
| LG Watch Sport (2017) | 1.38 <sub>inch</sub> | 480 x 480 <sub>px</sub> | 240 x 240 <sub>px</sub> | 348 <sub>ppi</sub> | 174 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | Android Wear 2.0 |
|
||||
| LG Watch Urbane 2nd Edition (2016) | 1.38 <sub>inch</sub> | 480 x 480 <sub>px</sub> | 240 x 240 <sub>px</sub> | 348 <sub>ppi</sub> | 174 <sub>ppi</sub> | 2 <sub>xhdpi</sub> | Android Wear 2.0 |
|
||||
| LG Watch W7 (2018) | 1.2 <sub>inch</sub> | 360 x 360 <sub>px</sub> | 240 x 240 <sub>px</sub> | 300 <sub>ppi</sub> | 200 <sub>ppi</sub> | 1.5 <sub>hdpi</sub> | Android Wear OS 2.0 |
|
||||
| Samsung Galaxy Watch (2018) | 1.3 <sub>inch</sub> | 360 x 360 <sub>px</sub> | 240 x 240 <sub>px</sub> | 278 <sub>ppi</sub> | 185 <sub>ppi</sub> | 1.5 <sub>hdpi</sub> | Tizen-based <br/>wearable OS 4.0 |
|
||||
{.show-header}
|
||||
|
||||
|
||||
|
||||
@@ -36,15 +36,15 @@ $ screen -r <name/pid>
|
||||
|
||||
|
||||
### Options {.col-span-2}
|
||||
| Options | Example | Description |
|
||||
|---------|-----------------------------------------|---------------------------------------|
|
||||
| `-S` | screen -S debug | Start a new session with session name |
|
||||
| `-ls` | screen -ls | List running sessions / screens |
|
||||
| `-x` | screen -x | Attach to a running session |
|
||||
| `-r` | screen -r debug | Attach to a running session with name |
|
||||
| `-R` | screen -R debug | Attach to a session _(Will create if it doesn't exist)_ |
|
||||
| `-d` | screen -d -m wget xxxx.com/large.file | Start screen in detached mode |
|
||||
| `-X` | screen -X -S debug kill | Kill a running session |
|
||||
| Options | Example | Description |
|
||||
|---------|---------------------------------------|---------------------------------------------------------|
|
||||
| `-S` | screen -S debug | Start a new session with session name |
|
||||
| `-ls` | screen -ls | List running sessions / screens |
|
||||
| `-x` | screen -x | Attach to a running session |
|
||||
| `-r` | screen -r debug | Attach to a running session with name |
|
||||
| `-R` | screen -R debug | Attach to a session _(Will create if it doesn't exist)_ |
|
||||
| `-d` | screen -d -m wget xxxx.com/large.file | Start screen in detached mode |
|
||||
| `-X` | screen -X -S debug kill | Kill a running session |
|
||||
{.show-header}
|
||||
|
||||
|
||||
@@ -52,39 +52,39 @@ $ screen -r <name/pid>
|
||||
|
||||
### Help
|
||||
|
||||
| Command | Description |
|
||||
|--------------|---------------------------------|
|
||||
| `Ctrl-A` `?` | See help _(Lists keybindings)_ |
|
||||
| Command | Description |
|
||||
|--------------|--------------------------------|
|
||||
| `Ctrl-A` `?` | See help _(Lists keybindings)_ |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
|
||||
### Window Management {.col-span-2 .row-span-2}
|
||||
| Command | Description |
|
||||
|--------------------------------------|-----------------------------------------------|
|
||||
| `Ctrl-A` `C` | Create new window |
|
||||
| `Ctrl-A` `Ctrl-A` | Change to last-visited active window |
|
||||
| `Ctrl-A` `0...9` | Change to window by number |
|
||||
| `Ctrl-A` `'` `<0...9 or title>` | Change to window by number or name |
|
||||
| `Ctrl-A` `N` or `Ctrl-A` `<space>` | Change to next window in list |
|
||||
| `Ctrl-A` `P` or `Ctrl-A` `<backspace>` | Change to previous window in list |
|
||||
| `Ctrl-A` `"` | See window list |
|
||||
| `Ctrl-A` `W` | Show window bar |
|
||||
| `Ctrl-A` `K` | Kill current window _(not recommended)_ |
|
||||
| `Ctrl-A` `\` | Kill all windows _(not recommended)_ |
|
||||
| `Ctrl-A` `A` | Rename current window |
|
||||
| Command | Description |
|
||||
|----------------------------------------|-----------------------------------------|
|
||||
| `Ctrl-A` `C` | Create new window |
|
||||
| `Ctrl-A` `Ctrl-A` | Change to last-visited active window |
|
||||
| `Ctrl-A` `0...9` | Change to window by number |
|
||||
| `Ctrl-A` `'` `<0...9 or title>` | Change to window by number or name |
|
||||
| `Ctrl-A` `N` or `Ctrl-A` `<space>` | Change to next window in list |
|
||||
| `Ctrl-A` `P` or `Ctrl-A` `<backspace>` | Change to previous window in list |
|
||||
| `Ctrl-A` `"` | See window list |
|
||||
| `Ctrl-A` `W` | Show window bar |
|
||||
| `Ctrl-A` `K` | Kill current window _(not recommended)_ |
|
||||
| `Ctrl-A` `\` | Kill all windows _(not recommended)_ |
|
||||
| `Ctrl-A` `A` | Rename current window |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
|
||||
### Getting Out
|
||||
|
||||
| Command | Description |
|
||||
|--------------|---------------------------------------|
|
||||
| `Ctrl-A` `D` | Detach |
|
||||
| `Ctrl-A` `D` `D` | Detach and logout <br>_(quick exit)_ |
|
||||
| `Ctrl-A` `:` | Exit all session |
|
||||
| `Ctrl-A` `C-\` | Force-exit screen <br>_(not recommended)_ |
|
||||
| Command | Description |
|
||||
|------------------|-------------------------------------------|
|
||||
| `Ctrl-A` `D` | Detach |
|
||||
| `Ctrl-A` `D` `D` | Detach and logout <br>_(quick exit)_ |
|
||||
| `Ctrl-A` `:` | Exit all session |
|
||||
| `Ctrl-A` `C-\` | Force-exit screen <br>_(not recommended)_ |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
@@ -106,18 +106,18 @@ $ screen -r <name/pid>
|
||||
|
||||
### Misc {.col-span-2 .row-span-2}
|
||||
|
||||
| Command | Description |
|
||||
|-------------------|--------------------------------------|
|
||||
| `Ctrl-A` `C-l` | Redraw window |
|
||||
| `Ctrl-A` `[` | Copy mode |
|
||||
| `Ctrl-A` `ESC` | Copy mode |
|
||||
| `Ctrl-A` `]` | Paste |
|
||||
| `Ctrl-A` `M` | Monitor window for activity |
|
||||
| `Ctrl-A` `_` | Monitor window for silence |
|
||||
| Command | Description |
|
||||
|-------------------|--------------------------------------------|
|
||||
| `Ctrl-A` `C-l` | Redraw window |
|
||||
| `Ctrl-A` `[` | Copy mode |
|
||||
| `Ctrl-A` `ESC` | Copy mode |
|
||||
| `Ctrl-A` `]` | Paste |
|
||||
| `Ctrl-A` `M` | Monitor window for activity |
|
||||
| `Ctrl-A` `_` | Monitor window for silence |
|
||||
| `Ctrl-A` `Ctrl-V` | Enter digraph <br>_(non-ASCII characters)_ |
|
||||
| `Ctrl-A` `X` | Lock (password protect) display |
|
||||
| `Ctrl-A` `:` | Enter screen command |
|
||||
| `Ctrl-A` `H` | Enable logging in the screen session |
|
||||
| `Ctrl-A` `X` | Lock (password protect) display |
|
||||
| `Ctrl-A` `:` | Enter screen command |
|
||||
| `Ctrl-A` `H` | Enable logging in the screen session |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ $ echo '123abc' | sed 's/[0-9]+//g'
|
||||
### Option Examples {.col-span-2}
|
||||
|
||||
| Option | Example | Description |
|
||||
| ------ | ------------------------------------------ |---------------------------------------- |
|
||||
|--------|--------------------------------------------|-----------------------------------------|
|
||||
| `-i` | sed -ibak 's/On/Off/' php.ini | Backup and modify input file directly |
|
||||
| `-E` | sed -E 's/[0-9]+//g' input-file | Use extended regular expressions |
|
||||
| `-n` | sed -n '3 p' config.conf | Suppress default pattern space printing |
|
||||
@@ -84,14 +84,14 @@ Sed commands {.cols-3}
|
||||
|
||||
### Commands {.col-span-2}
|
||||
|
||||
| Command | Example | Description |
|
||||
| ------- | --------------------------------------- |----------------------------- |
|
||||
| `p` | sed -n '1,4 p' input.txt | Print lines 1-4 |
|
||||
| `p` | sed -n -e '1,4 p' -e '6,7 p' input.txt | Print lines 1-4 and 6-7 |
|
||||
| `d` | sed '1,4 d' input.txt | Print lines except 1-4 |
|
||||
| `w` | sed -n '1,4 w output.txt' input.txt | Write pattern space to file |
|
||||
| `a` | sed '2 a new-line' input.txt | Append line after |
|
||||
| `i` | sed '2 i new-line' input.txt | Insert line before |
|
||||
| Command | Example | Description |
|
||||
|---------|----------------------------------------|-----------------------------|
|
||||
| `p` | sed -n '1,4 p' input.txt | Print lines 1-4 |
|
||||
| `p` | sed -n -e '1,4 p' -e '6,7 p' input.txt | Print lines 1-4 and 6-7 |
|
||||
| `d` | sed '1,4 d' input.txt | Print lines except 1-4 |
|
||||
| `w` | sed -n '1,4 w output.txt' input.txt | Write pattern space to file |
|
||||
| `a` | sed '2 a new-line' input.txt | Append line after |
|
||||
| `i` | sed '2 i new-line' input.txt | Insert line before |
|
||||
{.show-header}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ Sed commands {.cols-3}
|
||||
### Space commands
|
||||
|
||||
| Command | Description |
|
||||
| ------- |------------------------------------------------------------- |
|
||||
|---------|--------------------------------------------------------------|
|
||||
| `n` | Print pattern space, empty pattern space, and read next line |
|
||||
| `x` | Swap pattern space with hold space |
|
||||
| `h` | Copy pattern space to hold space |
|
||||
@@ -118,35 +118,35 @@ $ sed 's/old/new/[flags]' [input-file]
|
||||
```
|
||||
---
|
||||
|
||||
| Flag | Description |
|
||||
| ---------------- |-------------------------------------------- |
|
||||
| `g` | Global substitution |
|
||||
| `1,2...` | Substitute the nth occurrence |
|
||||
| `p` | Print only the substituted line |
|
||||
| `w` | Write only the substituted line to a file |
|
||||
| `I` | Ignore case while searching |
|
||||
| `e` | Substitute and execute in the command line |
|
||||
| Flag | Description |
|
||||
|----------|--------------------------------------------|
|
||||
| `g` | Global substitution |
|
||||
| `1,2...` | Substitute the nth occurrence |
|
||||
| `p` | Print only the substituted line |
|
||||
| `w` | Write only the substituted line to a file |
|
||||
| `I` | Ignore case while searching |
|
||||
| `e` | Substitute and execute in the command line |
|
||||
|
||||
|
||||
### Loops commands
|
||||
|
||||
| Command | Description |
|
||||
| ---------- |------------------------------------------------------------------- |
|
||||
| Command | Description |
|
||||
|-----------|--------------------------------------------------------------------|
|
||||
| `b label` | Branch to a label (for looping) |
|
||||
| `t label` | Branch to a label only on successful substitution<br>(for looping) |
|
||||
| `:label` | Label for the b and t commands (for looping) |
|
||||
| `N` | Append next line to pattern space |
|
||||
| `P` | Print 1st line in multi-line |
|
||||
| `D` | Delete 1st line in multi-line |
|
||||
| `N` | Append next line to pattern space |
|
||||
| `P` | Print 1st line in multi-line |
|
||||
| `D` | Delete 1st line in multi-line |
|
||||
|
||||
|
||||
|
||||
### Misc Flags
|
||||
| Flag | Description |
|
||||
| ---------------- |-------------------------------------------- |
|
||||
| `/ | ^ @ ! #` | Substitution delimiter can be any character |
|
||||
| `&` | Gets the matched pattern |
|
||||
| `( ) \1 \2 \3` | Group using `(` and `)`.<br>Use `\1`, `\2` in replacement to refer the group|
|
||||
| Flag | Description |
|
||||
|----------------|------------------------------------------------------------------------------|
|
||||
| `/ | ^ @ ! #` | Substitution delimiter can be any character |
|
||||
| `&` | Gets the matched pattern |
|
||||
| `( ) \1 \2 \3` | Group using `(` and `)`.<br>Use `\1`, `\2` in replacement to refer the group |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -76,13 +76,13 @@ $ tmux show-options -g
|
||||
|
||||
|
||||
### Copy Mode
|
||||
| Command | Description |
|
||||
|---------------------|------------------------------|
|
||||
| `Ctrl+b` `[` | Enter copy mode |
|
||||
| `<Space>` | Start selection |
|
||||
| `Enter` | Copy selection |
|
||||
| `q` | Quit copy mode |
|
||||
| `Ctrl+b` `]` | Paste contents of buffer_0 |
|
||||
| Command | Description |
|
||||
|--------------|----------------------------|
|
||||
| `Ctrl+b` `[` | Enter copy mode |
|
||||
| `<Space>` | Start selection |
|
||||
| `Enter` | Copy selection |
|
||||
| `q` | Quit copy mode |
|
||||
| `Ctrl+b` `]` | Paste contents of buffer_0 |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
@@ -96,9 +96,9 @@ Tmux shortcuts {.cols-3}
|
||||
--------------
|
||||
|
||||
### Getting started {.secondary}
|
||||
| Shortcuts | Description |
|
||||
|---------------------|------------------------------|
|
||||
| `Ctrl+b` `?` | List all shortcuts |
|
||||
| Shortcuts | Description |
|
||||
|--------------|--------------------|
|
||||
| `Ctrl+b` `?` | List all shortcuts |
|
||||
{.shortcuts .show-header}
|
||||
|
||||
<br/>
|
||||
@@ -132,29 +132,29 @@ $ tmux info
|
||||
|
||||
|
||||
### Window (Tabs) {.row-span-2}
|
||||
| - | - |
|
||||
|--------------------|--------------------------------|
|
||||
| `Ctrl+b` `c` | Create window |
|
||||
| `Ctrl+b` `p` _/_ `n` | Previous/Next window |
|
||||
| `Ctrl+b` `"` _/_ `%` | Split Horiz/Vert|
|
||||
| `Ctrl+b` `w` | List window |
|
||||
| `Ctrl+b` `,` | Rename window |
|
||||
| `Ctrl+b` `f` | Find window |
|
||||
| `Ctrl+b` `l` | Last window |
|
||||
| `Ctrl+b` `.` | Move window |
|
||||
| `Ctrl+b` `&` | Close window |
|
||||
| `Ctrl+b` `0`...`9` | Goto # window |
|
||||
| - | - |
|
||||
|----------------------|----------------------|
|
||||
| `Ctrl+b` `c` | Create window |
|
||||
| `Ctrl+b` `p` _/_ `n` | Previous/Next window |
|
||||
| `Ctrl+b` `"` _/_ `%` | Split Horiz/Vert |
|
||||
| `Ctrl+b` `w` | List window |
|
||||
| `Ctrl+b` `,` | Rename window |
|
||||
| `Ctrl+b` `f` | Find window |
|
||||
| `Ctrl+b` `l` | Last window |
|
||||
| `Ctrl+b` `.` | Move window |
|
||||
| `Ctrl+b` `&` | Close window |
|
||||
| `Ctrl+b` `0`...`9` | Goto # window |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
|
||||
### Session (Set of Windows)
|
||||
| - | - |
|
||||
|----------------|--------------------------|
|
||||
| `Ctrl+b` `d` | <red>Detach from session</red> |
|
||||
| `Ctrl+b` `s` | Show all sessions |
|
||||
| `Ctrl+b` `$` | Rename session |
|
||||
| `Ctrl+b` `(` _/_ `)` | Previous/Next session |
|
||||
| - | - |
|
||||
|----------------------|--------------------------------|
|
||||
| `Ctrl+b` `d` | <red>Detach from session</red> |
|
||||
| `Ctrl+b` `s` | Show all sessions |
|
||||
| `Ctrl+b` `$` | Rename session |
|
||||
| `Ctrl+b` `(` _/_ `)` | Previous/Next session |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
@@ -163,41 +163,41 @@ Tmux Command Mode {.cols-3}
|
||||
-----------
|
||||
|
||||
### Usage {.secondary}
|
||||
| Command | Description |
|
||||
|---------------------|------------------------------|
|
||||
| `Ctrl+b` `:` | Enter command mode |
|
||||
| Command | Description |
|
||||
|--------------|--------------------|
|
||||
| `Ctrl+b` `:` | Enter command mode |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
### Resizing
|
||||
|
||||
| Command | Description |
|
||||
|---------------------|------------------------------|
|
||||
| `resize-pane -D 20` | Resize down |
|
||||
| `resize-pane -U 20` | Resize up |
|
||||
| `resize-pane -L 20` | Resize left |
|
||||
| `resize-pane -R 20` | Resize right |
|
||||
| Command | Description |
|
||||
|---------------------|--------------|
|
||||
| `resize-pane -D 20` | Resize down |
|
||||
| `resize-pane -U 20` | Resize up |
|
||||
| `resize-pane -L 20` | Resize left |
|
||||
| `resize-pane -R 20` | Resize right |
|
||||
|
||||
|
||||
### Listing
|
||||
|
||||
| Command | Description |
|
||||
|---------------------|------------------------------|
|
||||
| `list-keys` | All commands |
|
||||
| `list-panes` | All panes |
|
||||
| `list-windows` | All Windows |
|
||||
| Command | Description |
|
||||
|----------------|--------------|
|
||||
| `list-keys` | All commands |
|
||||
| `list-panes` | All panes |
|
||||
| `list-windows` | All Windows |
|
||||
|
||||
|
||||
### Copying
|
||||
|
||||
| Command | Description |
|
||||
|-----------------------|-----------------------|
|
||||
| `list-buffers` | List all buffers |
|
||||
| `show-buffer` | Show #0 contents |
|
||||
| `capture-pane` | Copy of pane |
|
||||
| `choose-buffer` | Show and paste |
|
||||
| `save-buffer a.txt` | Save to file |
|
||||
| `delete-buffer -b 1` | Delete buffer 1 |
|
||||
| Command | Description |
|
||||
|----------------------|------------------|
|
||||
| `list-buffers` | List all buffers |
|
||||
| `show-buffer` | Show #0 contents |
|
||||
| `capture-pane` | Copy of pane |
|
||||
| `choose-buffer` | Show and paste |
|
||||
| `save-buffer a.txt` | Save to file |
|
||||
| `delete-buffer -b 1` | Delete buffer 1 |
|
||||
|
||||
|
||||
### Setting
|
||||
@@ -210,9 +210,9 @@ Tmux Command Mode {.cols-3}
|
||||
|
||||
|
||||
### Misc
|
||||
| Command | Description |
|
||||
|---------------------|------------------------------|
|
||||
| `swap-pane -s 3 -t 1`| Swap pane |
|
||||
| `swap-window -t -1`| Move to left |
|
||||
| `setw synchronize-panes`| Sync Panes |
|
||||
| `join-pane -t :#` | Join pane |
|
||||
| Command | Description |
|
||||
|--------------------------|--------------|
|
||||
| `swap-pane -s 3 -t 1` | Swap pane |
|
||||
| `swap-window -t -1` | Move to left |
|
||||
| `setw synchronize-panes` | Sync Panes |
|
||||
| `join-pane -t :#` | Join pane |
|
||||
@@ -65,10 +65,10 @@ G gg H M L k j ▶ print("to")
|
||||
{.shortcuts}
|
||||
|
||||
#### Words{.left-text}
|
||||
| Shortcut | Description |
|
||||
|---------------|---------------------------|
|
||||
| `b` _/_ `w` | Previous/Next word |
|
||||
| `ge` _/_ `e` | Previous/Next end of word |
|
||||
| Shortcut | Description |
|
||||
|--------------|---------------------------|
|
||||
| `b` _/_ `w` | Previous/Next word |
|
||||
| `ge` _/_ `e` | Previous/Next end of word |
|
||||
{.shortcuts}
|
||||
|
||||
#### Line
|
||||
@@ -81,20 +81,20 @@ G gg H M L k j ▶ print("to")
|
||||
|
||||
#### Character
|
||||
|
||||
| Shortcut | Description |
|
||||
|----------------|-------------------------------------|
|
||||
| `Fe` _/_ `fe` | Move to previous/next `e` |
|
||||
| `To` _/_ `to` | Move before/after previous/next `o` |
|
||||
| `|` _/_ `n|` | Go to first/`n`th column |
|
||||
| Shortcut | Description |
|
||||
|---------------|-------------------------------------|
|
||||
| `Fe` _/_ `fe` | Move to previous/next `e` |
|
||||
| `To` _/_ `to` | Move before/after previous/next `o` |
|
||||
| `|` _/_ `n|` | Go to first/`n`th column |
|
||||
{.shortcuts}
|
||||
|
||||
#### Document
|
||||
|
||||
| Shortcut | Description |
|
||||
|--------------|----------------------------|
|
||||
| `gg` _/_ `G` | First/Last line |
|
||||
| `:n` _\|_ `nG` | Go to line `n` |
|
||||
| `}` _/_ `{` | Next/Previous empty line |
|
||||
| Shortcut | Description |
|
||||
|----------------|--------------------------|
|
||||
| `gg` _/_ `G` | First/Last line |
|
||||
| `:n` _\|_ `nG` | Go to line `n` |
|
||||
| `}` _/_ `{` | Next/Previous empty line |
|
||||
{.shortcuts}
|
||||
|
||||
#### Window
|
||||
@@ -121,30 +121,30 @@ G gg H M L k j ▶ print("to")
|
||||
|
||||
|
||||
### Saving and Exiting
|
||||
| Shortcut | Description |
|
||||
|---------------------------|----------------------------|
|
||||
| `:w` | Save |
|
||||
| `:q` | Close file |
|
||||
| `:wq` _\|_ `:x` _\|_ `ZZ` | Save and quit |
|
||||
| `:wqa` | Save and quit all files |
|
||||
| `:q!` _\|_ `ZQ` | Force quit |
|
||||
| `:qa` | Close all files |
|
||||
| `:qa!` | Force quit all files |
|
||||
| `:w` new.txt | Write to `new.txt` |
|
||||
| `:sav` new.txt | Save and edit `new.txt` |
|
||||
| `:w` !sudo tee % | Write to readonly file |
|
||||
| Shortcut | Description |
|
||||
|---------------------------|-------------------------|
|
||||
| `:w` | Save |
|
||||
| `:q` | Close file |
|
||||
| `:wq` _\|_ `:x` _\|_ `ZZ` | Save and quit |
|
||||
| `:wqa` | Save and quit all files |
|
||||
| `:q!` _\|_ `ZQ` | Force quit |
|
||||
| `:qa` | Close all files |
|
||||
| `:qa!` | Force quit all files |
|
||||
| `:w` new.txt | Write to `new.txt` |
|
||||
| `:sav` new.txt | Save and edit `new.txt` |
|
||||
| `:w` !sudo tee % | Write to readonly file |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
|
||||
### Normal Mode
|
||||
| Shortcut | Description |
|
||||
|-----------------------|--------------------------|
|
||||
| `r` | Replace one character |
|
||||
| `R` | Enter Replace mode |
|
||||
| Shortcut | Description |
|
||||
|-----------------------|------------------------------|
|
||||
| `r` | Replace one character |
|
||||
| `R` | Enter Replace mode |
|
||||
| `u` _/_ `3u` | Undo changes `1` / `3` times |
|
||||
| `U` | Undo changes on one line |
|
||||
| `J` | Join with next line |
|
||||
| `U` | Undo changes on one line |
|
||||
| `J` | Join with next line |
|
||||
| `<C-r>` _/_ 5 `<C-r>` | Redo changes `1` / `5` times |
|
||||
{.shortcuts}
|
||||
|
||||
@@ -357,20 +357,20 @@ Vim Multiple files {.cols-3}
|
||||
|
||||
|
||||
### Buffers
|
||||
| - | - |
|
||||
|-------------|----------------------------------|
|
||||
| `:e file` | Edit a file in a new buffer |
|
||||
| `:bn` | Go to the next buffer |
|
||||
| `:bp` | Go to the previous buffer |
|
||||
| `:bd` | Remove file from buffer list |
|
||||
| `:b 5` | Open buffer #5 |
|
||||
| `:b file` | Go to a buffer by file |
|
||||
| `:ls` | List all open buffers |
|
||||
| `:sp file` | Open and split window |
|
||||
| `:vs file` | Open and vertically split window |
|
||||
| `:hid` | Hide this buffer |
|
||||
| `:wn` | Write file and move to next |
|
||||
| `:tab ba` | Edit all buffers as tabs |
|
||||
| - | - |
|
||||
|------------|----------------------------------|
|
||||
| `:e file` | Edit a file in a new buffer |
|
||||
| `:bn` | Go to the next buffer |
|
||||
| `:bp` | Go to the previous buffer |
|
||||
| `:bd` | Remove file from buffer list |
|
||||
| `:b 5` | Open buffer #5 |
|
||||
| `:b file` | Go to a buffer by file |
|
||||
| `:ls` | List all open buffers |
|
||||
| `:sp file` | Open and split window |
|
||||
| `:vs file` | Open and vertically split window |
|
||||
| `:hid` | Hide this buffer |
|
||||
| `:wn` | Write file and move to next |
|
||||
| `:tab ba` | Edit all buffers as tabs |
|
||||
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ Vim Multiple files {.cols-3}
|
||||
| `<C-w>` `x` | Swap current with next |
|
||||
| `<C-w>` `-` _/_ `+` | Decrease/Increase height |
|
||||
| `<C-w>` `<` _/_ `>` | Decrease/Increase width |
|
||||
| `<C-w>` `|` | Max out the width |
|
||||
| `<C-w>` `|` | Max out the width |
|
||||
| `<C-w>` `=` | Equally high and wide |
|
||||
| `<C-w>` `h` _/_ `l` | Go to the left/right window |
|
||||
| `<C-w>` `j` _/_ `k` | Go to the up/down window |
|
||||
@@ -394,18 +394,18 @@ Vim Multiple files {.cols-3}
|
||||
|
||||
|
||||
### Tabs
|
||||
| Shortcut | Description |
|
||||
|--------------------|-----------------------------------|
|
||||
| `:tabe [file]` | <yel>E</yel>dit file in a new tab |
|
||||
| `:tabf [file]` | Open if exists in new tab |
|
||||
| `:tabc` | <yel>C</yel>lose current tab |
|
||||
| `:tabo` | Close <yel>o</yel>ther tabs |
|
||||
| `:tabs` | List all <yel>tabs</yel> |
|
||||
| `:tabr` | Go to fi<yel>r</yel>st tab |
|
||||
| `:tabl` | Go to <yel>l</yel>ast tab |
|
||||
| `:tabm 0` | <yel>M</yel>ove to position `0` |
|
||||
| `:tabn` | Go to <yel>n</yel>ext tab |
|
||||
| `:tabp` | Go to <yel>p</yel>revious tab |
|
||||
| Shortcut | Description |
|
||||
|----------------|-----------------------------------|
|
||||
| `:tabe [file]` | <yel>E</yel>dit file in a new tab |
|
||||
| `:tabf [file]` | Open if exists in new tab |
|
||||
| `:tabc` | <yel>C</yel>lose current tab |
|
||||
| `:tabo` | Close <yel>o</yel>ther tabs |
|
||||
| `:tabs` | List all <yel>tabs</yel> |
|
||||
| `:tabr` | Go to fi<yel>r</yel>st tab |
|
||||
| `:tabl` | Go to <yel>l</yel>ast tab |
|
||||
| `:tabm 0` | <yel>M</yel>ove to position `0` |
|
||||
| `:tabn` | Go to <yel>n</yel>ext tab |
|
||||
| `:tabp` | Go to <yel>p</yel>revious tab |
|
||||
|
||||
|
||||
#### Normal mode
|
||||
@@ -424,16 +424,16 @@ Vim Search and Replace {.cols-3}
|
||||
------------------
|
||||
|
||||
### Search
|
||||
| - | - |
|
||||
|----------|-------------------------------------------------|
|
||||
| `/foo` | Search forward |
|
||||
| `/foo\c` | Search forward _(case insensitive)_ |
|
||||
| `?foo` | Search backward |
|
||||
| `/\v\d+` | Search with [regex](/regex) |
|
||||
| `n` | Next matching search pattern |
|
||||
| `N` | Previous match |
|
||||
| `*` | Search for current word forward |
|
||||
| `#` | Search for current word backward |
|
||||
| - | - |
|
||||
|----------|-------------------------------------|
|
||||
| `/foo` | Search forward |
|
||||
| `/foo\c` | Search forward _(case insensitive)_ |
|
||||
| `?foo` | Search backward |
|
||||
| `/\v\d+` | Search with [regex](/regex) |
|
||||
| `n` | Next matching search pattern |
|
||||
| `N` | Previous match |
|
||||
| `*` | Search for current word forward |
|
||||
| `#` | Search for current word backward |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
@@ -445,14 +445,14 @@ Vim Search and Replace {.cols-3}
|
||||
|
||||
---
|
||||
|
||||
| | |
|
||||
|-------------------|---------------------------------|
|
||||
| `:s/old/new` | Replace first |
|
||||
| `:s/old/new/g` | Replace all |
|
||||
| `:s/\vold/new/g` | Replace all with [regex](/regex)|
|
||||
| `:s/old/new/gc` | replace all _(Confirm)_ |
|
||||
| `:s/old/new/i` | Ignore case replace first |
|
||||
| `:2,6s/old/new/g` | Replace between lines `2`-`6` |
|
||||
| | |
|
||||
|-------------------|----------------------------------|
|
||||
| `:s/old/new` | Replace first |
|
||||
| `:s/old/new/g` | Replace all |
|
||||
| `:s/\vold/new/g` | Replace all with [regex](/regex) |
|
||||
| `:s/old/new/gc` | replace all _(Confirm)_ |
|
||||
| `:s/old/new/i` | Ignore case replace first |
|
||||
| `:2,6s/old/new/g` | Replace between lines `2`-`6` |
|
||||
|
||||
### Replace FILE
|
||||
```vim
|
||||
@@ -461,28 +461,28 @@ Vim Search and Replace {.cols-3}
|
||||
|
||||
---
|
||||
|
||||
| | |
|
||||
|-------------------|-----------------------------|
|
||||
| `:%s/old/new` | Replace first |
|
||||
| `:%s/old/new/g` | Replace all |
|
||||
| `:%s/old/new/gc` | Replace all _(Confirm)_ |
|
||||
| `:%s/old/new/gi` | Replace all _(ignore case)_ |
|
||||
| `:%s/\vold/new/g` | Replace all with [regex](/regex)|
|
||||
| | |
|
||||
|-------------------|----------------------------------|
|
||||
| `:%s/old/new` | Replace first |
|
||||
| `:%s/old/new/g` | Replace all |
|
||||
| `:%s/old/new/gc` | Replace all _(Confirm)_ |
|
||||
| `:%s/old/new/gi` | Replace all _(ignore case)_ |
|
||||
| `:%s/\vold/new/g` | Replace all with [regex](/regex) |
|
||||
|
||||
|
||||
|
||||
### Ranges {.row-span-2}
|
||||
| - | - |
|
||||
|---------|--------------------|
|
||||
| `%` | Entire file |
|
||||
| `’<,’>` | Current selection |
|
||||
| `5` | Line `5` |
|
||||
| `5,10` | Lines `5` to `10` |
|
||||
| `$` | Last line |
|
||||
| `2,$` | Lines `2` to Last |
|
||||
| `.` | Current line |
|
||||
| `,3` | Next `3` lines |
|
||||
| `-3,` | Forward `3` lines |
|
||||
| - | - |
|
||||
|---------|-------------------|
|
||||
| `%` | Entire file |
|
||||
| `’<,’>` | Current selection |
|
||||
| `5` | Line `5` |
|
||||
| `5,10` | Lines `5` to `10` |
|
||||
| `$` | Last line |
|
||||
| `2,$` | Lines `2` to Last |
|
||||
| `.` | Current line |
|
||||
| `,3` | Next `3` lines |
|
||||
| `-3,` | Forward `3` lines |
|
||||
|
||||
|
||||
|
||||
@@ -511,9 +511,9 @@ Vim Search and Replace {.cols-3}
|
||||
```
|
||||
---
|
||||
|
||||
| | |
|
||||
|---------------|------------------------------------------------------------|
|
||||
| `:v/foo/d` | Delete lines not containing `foo`<br/>_(also `:g!/foo/d`)_ |
|
||||
| | |
|
||||
|------------|------------------------------------------------------------|
|
||||
| `:v/foo/d` | Delete lines not containing `foo`<br/>_(also `:g!/foo/d`)_ |
|
||||
|
||||
|
||||
|
||||
@@ -530,16 +530,16 @@ Vim Search and Replace {.cols-3}
|
||||
|
||||
|
||||
### Substitute expression (magic)
|
||||
| - | - |
|
||||
|--------------|----------------------------------|
|
||||
| `&` _\|_ `\0`| Replace with the whole matched |
|
||||
| `\1`...`\9` | Replace with the group 0-9 |
|
||||
| `\u` | Uppercase next letter |
|
||||
| `\U` | Uppercase following characters |
|
||||
| `\l` | Lowercase next letter |
|
||||
| `\L` | Lowercase following characters |
|
||||
| `\e` | End of `\u`, `\U`, `\l` and `\L` |
|
||||
| `\E` | End of `\u`, `\U`, `\l` and `\L` |
|
||||
| - | - |
|
||||
|---------------|----------------------------------|
|
||||
| `&` _\|_ `\0` | Replace with the whole matched |
|
||||
| `\1`...`\9` | Replace with the group 0-9 |
|
||||
| `\u` | Uppercase next letter |
|
||||
| `\U` | Uppercase following characters |
|
||||
| `\l` | Lowercase next letter |
|
||||
| `\L` | Lowercase following characters |
|
||||
| `\e` | End of `\u`, `\U`, `\l` and `\L` |
|
||||
| `\E` | End of `\u`, `\U`, `\l` and `\L` |
|
||||
|
||||
|
||||
|
||||
@@ -602,7 +602,7 @@ See: [Ranges](#ranges)
|
||||
### Folds {.row-span-2}
|
||||
|
||||
| Shortcut | Description |
|
||||
| --- | --- |
|
||||
|---------------|------------------------------|
|
||||
| `zo` _/_ `zO` | Open |
|
||||
| `zc` _/_ `zC` | Close |
|
||||
| `za` _/_ `zA` | Toggle |
|
||||
@@ -619,10 +619,10 @@ See: [Ranges](#ranges)
|
||||
### Jumping
|
||||
<br>
|
||||
|
||||
| Shortcut | Description |
|
||||
| --- | --- |
|
||||
| `]c` | Next difference |
|
||||
| `[c` | Previous difference |
|
||||
| Shortcut | Description |
|
||||
|----------|---------------------|
|
||||
| `]c` | Next difference |
|
||||
| `[c` | Previous difference |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
@@ -657,11 +657,11 @@ Miscellaneous {.cols-3}
|
||||
|
||||
### Jumping
|
||||
|
||||
| Shortcut | Description |
|
||||
|----------|----------------------|
|
||||
| `<C-o>` | Go back to previous |
|
||||
| `<C-i>` | Go forward |
|
||||
| `gf` | Go to file in cursor |
|
||||
| Shortcut | Description |
|
||||
|----------|--------------------------|
|
||||
| `<C-o>` | Go back to previous |
|
||||
| `<C-i>` | Go forward |
|
||||
| `gf` | Go to file in cursor |
|
||||
| `ga` | Display hex, ascii value |
|
||||
{.shortcuts}
|
||||
|
||||
@@ -669,17 +669,17 @@ Miscellaneous {.cols-3}
|
||||
|
||||
|
||||
### Misc command-lines {.row-span-2}
|
||||
| - | - |
|
||||
|------------------------|-------------------------------|
|
||||
| `:h` | Help open help view |
|
||||
| `:edit!` | Reload current file |
|
||||
| `:2,8m0` | Move lines `2`-`8` to `0` |
|
||||
| `:noh` | Clear search highlights |
|
||||
| `:sort` | Sort lines |
|
||||
| `:ter` | Open a terminal window |
|
||||
| `:set paste` | Enable Insert Paste sub-mode |
|
||||
| `:set nopaste` | disable Insert Paste sub-mode |
|
||||
| `:cq` | Exiting with an error<br/>_(aborting Git)_ |
|
||||
| - | - |
|
||||
|----------------|--------------------------------------------|
|
||||
| `:h` | Help open help view |
|
||||
| `:edit!` | Reload current file |
|
||||
| `:2,8m0` | Move lines `2`-`8` to `0` |
|
||||
| `:noh` | Clear search highlights |
|
||||
| `:sort` | Sort lines |
|
||||
| `:ter` | Open a terminal window |
|
||||
| `:set paste` | Enable Insert Paste sub-mode |
|
||||
| `:set nopaste` | disable Insert Paste sub-mode |
|
||||
| `:cq` | Exiting with an error<br/>_(aborting Git)_ |
|
||||
|
||||
|
||||
### Navigating
|
||||
@@ -696,8 +696,8 @@ Miscellaneous {.cols-3}
|
||||
|
||||
### Counters
|
||||
|
||||
| Shortcut | Description |
|
||||
| --- | --- |
|
||||
| Shortcut | Description |
|
||||
|----------|-----------------|
|
||||
| `<C-a>` | Increase number |
|
||||
| `<C-x>` | Decrease number |
|
||||
{.shortcuts}
|
||||
@@ -705,24 +705,24 @@ Miscellaneous {.cols-3}
|
||||
|
||||
### Tags {.row-span-2 .col-span-2}
|
||||
|
||||
| Shortcut | Description |
|
||||
| --- | --- |
|
||||
| `:tag Classname` | Jump to first definition of Classname |
|
||||
| `<C-]>` | Jump to definition |
|
||||
| `g]` | See all definitions |
|
||||
| `<C-t>` | Go back to last tag |
|
||||
| `<C-o> <C-i>` | Back/forward |
|
||||
| `:tselect Classname` | Find definitions of Classname |
|
||||
| `:tjump Classname` | Find definitions of Classname (auto-select 1st) |
|
||||
| Shortcut | Description |
|
||||
|----------------------|-------------------------------------------------|
|
||||
| `:tag Classname` | Jump to first definition of Classname |
|
||||
| `<C-]>` | Jump to definition |
|
||||
| `g]` | See all definitions |
|
||||
| `<C-t>` | Go back to last tag |
|
||||
| `<C-o> <C-i>` | Back/forward |
|
||||
| `:tselect Classname` | Find definitions of Classname |
|
||||
| `:tjump Classname` | Find definitions of Classname (auto-select 1st) |
|
||||
{.shortcuts}
|
||||
|
||||
|
||||
### Formatting
|
||||
| - | - |
|
||||
|-----------------|---|
|
||||
| `:ce 8` | Center lines between `8` columns |
|
||||
| `:ri 4` | Right-align lines at `4` columns |
|
||||
| `:le` | Left-align lines |
|
||||
| - | - |
|
||||
|---------|----------------------------------|
|
||||
| `:ce 8` | Center lines between `8` columns |
|
||||
| `:ri 4` | Right-align lines at `4` columns |
|
||||
| `:le` | Left-align lines |
|
||||
|
||||
See `:help formatting`
|
||||
|
||||
@@ -762,10 +762,10 @@ See `:help formatting`
|
||||
|
||||
### Calculator
|
||||
|
||||
| Shortcut | Description |
|
||||
| --- | --- |
|
||||
| `<C-r>` `=` 7*7 | Shows the result |
|
||||
| `<C-r>` `=` 10/2 | Shows the result |
|
||||
| Shortcut | Description |
|
||||
|------------------|------------------|
|
||||
| `<C-r>` `=` 7*7 | Shows the result |
|
||||
| `<C-r>` `=` 10/2 | Shows the result |
|
||||
{.shortcuts}
|
||||
|
||||
Do this in INSERT mode
|
||||
@@ -774,12 +774,12 @@ Do this in INSERT mode
|
||||
|
||||
|
||||
### Shell
|
||||
| - | - |
|
||||
|------------------------|-------------------------------|
|
||||
| `:!<shell>` | Interpret Shell Command |
|
||||
| `:r!<shell>` | Read in output of shell |
|
||||
| `:r!date` | Insert date |
|
||||
| `:!!date` | Replace current line with date |
|
||||
| - | - |
|
||||
|--------------|--------------------------------|
|
||||
| `:!<shell>` | Interpret Shell Command |
|
||||
| `:r!<shell>` | Read in output of shell |
|
||||
| `:r!date` | Insert date |
|
||||
| `:!!date` | Replace current line with date |
|
||||
|
||||
|
||||
|
||||
@@ -787,7 +787,7 @@ Do this in INSERT mode
|
||||
### Command line
|
||||
|
||||
| Shortcut | Description |
|
||||
| --- | --- |
|
||||
|--------------|-------------------------------------------|
|
||||
| `<C-r><C-w>` | Insert current word into the command line |
|
||||
| `<C-r>"` | Paste from " register |
|
||||
| `<C-x><C-f>` | Auto-completion of path in insert mode |
|
||||
|
||||
@@ -32,22 +32,22 @@ $x('//a[text()="XPath"]')[0].click()
|
||||
|
||||
### Descendant selectors {.col-span-2}
|
||||
|
||||
| Xpath | CSS |
|
||||
| ---- | ---- |
|
||||
| `//h1` | h1 |
|
||||
| `//div//p` | div p |
|
||||
| `//ul/li` | ul > li |
|
||||
| `//ul/li/a` | ul > li > a |
|
||||
| `//div/*` | div > * |
|
||||
| `/` | :root |
|
||||
| `/html/body` | :root > body |
|
||||
| Xpath | CSS |
|
||||
|--------------|--------------|
|
||||
| `//h1` | h1 |
|
||||
| `//div//p` | div p |
|
||||
| `//ul/li` | ul > li |
|
||||
| `//ul/li/a` | ul > li > a |
|
||||
| `//div/*` | div > * |
|
||||
| `/` | :root |
|
||||
| `/html/body` | :root > body |
|
||||
{.show-header}
|
||||
|
||||
|
||||
### Order selectors {.col-span-2}
|
||||
|
||||
| Xpath | CSS |
|
||||
|-------------------|------------------------|
|
||||
| Xpath | CSS |
|
||||
|---------------------|----------------------|
|
||||
| `//ul/li[1]` | ul > li:first-child |
|
||||
| `//ul/li[2]` | ul > li:nth-child(2) |
|
||||
| `//ul/li[last()]` | ul > li:last-child |
|
||||
@@ -59,22 +59,22 @@ $x('//a[text()="XPath"]')[0].click()
|
||||
|
||||
### Attribute selectors {.col-span-3 .row-span-2}
|
||||
|
||||
| Xpath | CSS |
|
||||
|---------------------------------|------------------------|
|
||||
| `//*[@id="id"]` | #id |
|
||||
| `//*[@class="class"]` | .class |
|
||||
| `//input[@type="submit"]` | input[type="submit"] |
|
||||
| `//a[@id="abc"][@for="xyz"]` | a#abc[for="xyz"] |
|
||||
| `//a[@rel]` | a[rel] |
|
||||
| `//a[starts-with(@href, '/')]` | a[href^='/'] |
|
||||
| `//a[ends-with(@href, '.pdf')]` | a[href$='pdf'] |
|
||||
| `//a[contains(@href, '://')]` | a[href*='`:`//'] |
|
||||
| `//a[contains(@rel, 'help')]` | a[rel~='help'] |
|
||||
| Xpath | CSS |
|
||||
|---------------------------------|----------------------|
|
||||
| `//*[@id="id"]` | #id |
|
||||
| `//*[@class="class"]` | .class |
|
||||
| `//input[@type="submit"]` | input[type="submit"] |
|
||||
| `//a[@id="abc"][@for="xyz"]` | a#abc[for="xyz"] |
|
||||
| `//a[@rel]` | a[rel] |
|
||||
| `//a[starts-with(@href, '/')]` | a[href^='/'] |
|
||||
| `//a[ends-with(@href, '.pdf')]` | a[href$='pdf'] |
|
||||
| `//a[contains(@href, '://')]` | a[href*='`:`//'] |
|
||||
| `//a[contains(@rel, 'help')]` | a[rel~='help'] |
|
||||
{.show-header}
|
||||
|
||||
|
||||
### Siblings {.col-span-3}
|
||||
| Xpath | CSS |
|
||||
| Xpath | CSS |
|
||||
|--------------------------------------|----------|
|
||||
| `//h1/following-sibling::ul` | h1 ~ ul |
|
||||
| `//h1/following-sibling::ul[1]` | h1 + ul |
|
||||
@@ -83,7 +83,7 @@ $x('//a[text()="XPath"]')[0].click()
|
||||
|
||||
|
||||
### jQuery {.col-span-3}
|
||||
| Xpath | CSS |
|
||||
| Xpath | CSS |
|
||||
|----------------------------------|----------------------------|
|
||||
| `//ul/li/..` | $('ul > li').parent() |
|
||||
| `//li/ancestor-or-self::section` | $('li').closest('section') |
|
||||
@@ -93,16 +93,16 @@ $x('//a[text()="XPath"]')[0].click()
|
||||
|
||||
|
||||
### Misc selectors {.col-span-3}
|
||||
| Xpath | CSS |
|
||||
|-----------------------------------|-------------------------|
|
||||
| `//h1[not(@id)]` | h1:not([id]) |
|
||||
| `//button[text()="Submit"]` | Text match |
|
||||
| `//button[contains(text(),"Go")]` | Text contains (substring) |
|
||||
| `//product[@price > 2.50]` | Arithmetic |
|
||||
| `//ul[*]` | Has children |
|
||||
| `//ul[li]` | Has children (specific) |
|
||||
| `//a[@name or @href]` | Or logic |
|
||||
| `//a | //div` | Union (joins results) |
|
||||
| Xpath | CSS |
|
||||
|-----------------------------------|---------------------------|
|
||||
| `//h1[not(@id)]` | h1:not([id]) |
|
||||
| `//button[text()="Submit"]` | Text match |
|
||||
| `//button[contains(text(),"Go")]` | Text contains (substring) |
|
||||
| `//product[@price > 2.50]` | Arithmetic |
|
||||
| `//ul[*]` | Has children |
|
||||
| `//ul[li]` | Has children (specific) |
|
||||
| `//a[@name or @href]` | Or logic |
|
||||
| `//a | //div` | Union (joins results) |
|
||||
{.show-header}
|
||||
|
||||
|
||||
@@ -327,10 +327,10 @@ Steps of an expression are separated by `/`, usually used to pick child nodes. T
|
||||
|
||||
### Other axes {.row-span-2}
|
||||
|
||||
| Axis | Abbrev | Notes |
|
||||
| --- | --- | --- |
|
||||
| `ancestor` | | |
|
||||
| `ancestor-or-self` | | |
|
||||
| Axis | Abbrev | Notes |
|
||||
|--------------------|--------|-------|
|
||||
| `ancestor` | | |
|
||||
| `ancestor-or-self` | | |
|
||||
|
||||
| `attribute` | `@` | `@href` is short for `attribute::href` |
|
||||
| `child` | | `div` is short for `child::div` |
|
||||
|
||||
@@ -406,10 +406,10 @@ Based on the YAML.org [refcard](https://yaml.org/refcard.html).
|
||||
|
||||
### Alias indicators
|
||||
|
||||
| | |
|
||||
|--------------|-------------------------------------------------------------|
|
||||
| `&` | Anchor property |
|
||||
| `*` | Alias indicator |
|
||||
| | |
|
||||
|-----|-----------------|
|
||||
| `&` | Anchor property |
|
||||
| `*` | Alias indicator |
|
||||
|
||||
|
||||
### Special keys
|
||||
@@ -422,42 +422,42 @@ Based on the YAML.org [refcard](https://yaml.org/refcard.html).
|
||||
|
||||
### Scalar indicators
|
||||
|
||||
| | |
|
||||
|------|-------------------------------------------------|
|
||||
| `''` | Surround in-line unescaped scalar |
|
||||
| `"` | Surround in-line escaped scalar |
|
||||
| `|` | Block scalar indicator |
|
||||
| `>` | Folded scalar indicator |
|
||||
| `-` | Strip chomp modifier (`|-` or `>-`) |
|
||||
| `+` | Keep chomp modifier (`|+` or `>+`) |
|
||||
| `1-9`| Explicit indentation modifier (`|1` or `>2`). <br/> Modifiers can be combined (`|2-`, `>+1`) |
|
||||
| | |
|
||||
|-------|----------------------------------------------------------------------------------------------|
|
||||
| `''` | Surround in-line unescaped scalar |
|
||||
| `"` | Surround in-line escaped scalar |
|
||||
| `|` | Block scalar indicator |
|
||||
| `>` | Folded scalar indicator |
|
||||
| `-` | Strip chomp modifier (`|-` or `>-`) |
|
||||
| `+` | Keep chomp modifier (`|+` or `>+`) |
|
||||
| `1-9` | Explicit indentation modifier (`|1` or `>2`). <br/> Modifiers can be combined (`|2-`, `>+1`) |
|
||||
|
||||
|
||||
### Tag Property (usually unspecified) {.col-span-2}
|
||||
| | |
|
||||
|--------------|-------------------------------------------------------------|
|
||||
| `none` | Unspecified tag (automatically resolved by application) |
|
||||
| `!` | Non-specific tag (by default, `!!map`/`!!seq`/`!!str`) |
|
||||
| `!foo` | Primary (by convention, means a local `!foo` tag) |
|
||||
| `!!foo` | Secondary (by convention, means `tag:yaml.org,2002:foo`) |
|
||||
| `!h!foo` | Requires `%TAG !h! <prefix>` (and then means `<prefix>foo`) |
|
||||
| `!<foo>` | Verbatim tag (always means `foo`) |
|
||||
| | |
|
||||
|----------|-------------------------------------------------------------|
|
||||
| `none` | Unspecified tag (automatically resolved by application) |
|
||||
| `!` | Non-specific tag (by default, `!!map`/`!!seq`/`!!str`) |
|
||||
| `!foo` | Primary (by convention, means a local `!foo` tag) |
|
||||
| `!!foo` | Secondary (by convention, means `tag:yaml.org,2002:foo`) |
|
||||
| `!h!foo` | Requires `%TAG !h! <prefix>` (and then means `<prefix>foo`) |
|
||||
| `!<foo>` | Verbatim tag (always means `foo`) |
|
||||
|
||||
### Misc indicators
|
||||
|
||||
| | |
|
||||
|------------------|------------------------------|
|
||||
| `#` | Throwaway comment indicator |
|
||||
| | |
|
||||
|-----|-----------------------------|
|
||||
| `#` | Throwaway comment indicator |
|
||||
| <code>\`@</code> | Both reserved for future use |
|
||||
|
||||
|
||||
### Core types (default automatic tags) {.row-span-2}
|
||||
|
||||
| | |
|
||||
|---------|----------------------------------------|
|
||||
| | |
|
||||
|---------|------------------------------------------|
|
||||
| `!!map` | `{Hash table, dictionary, mapping}` |
|
||||
| `!!seq` | `{List, array, tuple, vector, sequence}` |
|
||||
| `!!str` | Unicode string |
|
||||
| `!!str` | Unicode string |
|
||||
|
||||
|
||||
|
||||
@@ -509,14 +509,14 @@ Based on the YAML.org [refcard](https://yaml.org/refcard.html).
|
||||
|
||||
### Language Independent Scalar Types {.col-span-2}
|
||||
|
||||
| | |
|
||||
|---------------------------|----------------------------------------------|
|
||||
| `{~, null}` | Null (no value). |
|
||||
| `[1234, 0x4D2, 02333]` | [Decimal int, Hexadecimal int, Octal int] |
|
||||
| `[1_230.15, 12.3015e+02]` | [Fixed float, Exponential float] |
|
||||
| `[.inf, -.Inf, .NAN]` | [Infinity (float), Negative, Not a number] |
|
||||
| `{Y, true, Yes, ON}` | Boolean true |
|
||||
| `{n, FALSE, No, off}` | Boolean false |
|
||||
| | |
|
||||
|---------------------------|--------------------------------------------|
|
||||
| `{~, null}` | Null (no value). |
|
||||
| `[1234, 0x4D2, 02333]` | [Decimal int, Hexadecimal int, Octal int] |
|
||||
| `[1_230.15, 12.3015e+02]` | [Fixed float, Exponential float] |
|
||||
| `[.inf, -.Inf, .NAN]` | [Infinity (float), Negative, Not a number] |
|
||||
| `{Y, true, Yes, ON}` | Boolean true |
|
||||
| `{n, FALSE, No, off}` | Boolean false |
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user