Skip to content

Instantly share code, notes, and snippets.

@csswizardry
Last active August 2, 2022 20:01
Show Gist options
  • Select an option

  • Save csswizardry/685119f90eeccb6c089d6107f7d09758 to your computer and use it in GitHub Desktop.

Select an option

Save csswizardry/685119f90eeccb6c089d6107f7d09758 to your computer and use it in GitHub Desktop.

Revisions

  1. csswizardry revised this gist Oct 14, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion explainer.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ gg qq j0 :s/⎵/⎵+⎵/g y$ A ⎵=⎵ <C-r>= (<C-r>")/5⏎ <Esc> q @⁠q @@ @@
    * `gg`: Jump to the top of the file
    * `qq`: Begin recording a macro into register `q`
    * `j0`: Drop down a line and back to its first character
    * `:s/⎵/⎵+⎵/g`: Substitute every space on the current line for an equals sign
    * `:s/⎵/⎵+⎵/g`: Substitute every space on the current line for a plus sign
    * `y$`: Yank (copy) from the beginning of the line to the end
    * `A`: Append text onto the end of the current line
    * `⎵=⎵`: Type an = sign with a space either side
  2. csswizardry revised this gist Oct 14, 2019. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions explainer.md
    Original file line number Diff line number Diff line change
    @@ -31,3 +31,14 @@ gg qq j0 :s/⎵/⎵+⎵/g y$ A ⎵=⎵ <C-r>= (<C-r>")/5⏎ <Esc> q @⁠q @@ @@
    * `@@`: Run the last macro (i.e. q) again
    * `@@`: Run the last macro (i.e. q) again
    * `:2,6sort /[=]/⏎`: Sort lines 2–6 based on the value that appears after the = sign

    That will leave you looking at this:

    ```
    Run 1 Run 2 Run 3 Run 4 Run 5
    1.501 + 1.885 + 1.921 + 1.235 + 1.873 = 1.683
    1.991 + 1.871 + 1.885 + 2.007 + 2.114 = 1.9736
    2.018 + 2.091 + 2.115 + 2.241 + 2.020 = 2.097
    2.009 + 2.211 + 2.199 + 2.281 + 2.094 = 2.1588
    2.782 + 2.105 + 2.506 + 2.660 + 2.273 = 2.4652
    ```
  3. csswizardry revised this gist Oct 14, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions explainer.md
    Original file line number Diff line number Diff line change
    @@ -2,11 +2,11 @@ Given the following dataset:

    ```
    Run 1 Run 2 Run 3 Run 4 Run 5
    1.501 1.885 1.921 1.235 1.873
    1.991 1.871 1.885 2.007 2.114
    2.018 2.091 2.115 2.241 2.020
    2.009 2.211 2.199 2.281 2.094
    2.018 2.091 2.115 2.241 2.020
    2.782 2.105 2.506 2.660 2.273
    1.501 1.885 1.921 1.235 1.873
    ```

    …and the following series of Vim commands:
  4. csswizardry revised this gist Oct 14, 2019. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions explainer.md
    Original file line number Diff line number Diff line change
    @@ -2,11 +2,11 @@ Given the following dataset:

    ```
    Run 1 Run 2 Run 3 Run 4 Run 5
    1.501 + 1.885 + 1.921 + 1.235 + 1.873 = 1.683
    1.991 + 1.871 + 1.885 + 2.007 + 2.114 = 1.9736
    2.018 + 2.091 + 2.115 + 2.241 + 2.020 = 2.097
    2.009 + 2.211 + 2.199 + 2.281 + 2.094 = 2.1588
    2.782 + 2.105 + 2.506 + 2.660 + 2.273 = 2.4652
    1.501 1.885 1.921 1.235 1.873
    1.991 1.871 1.885 2.007 2.114
    2.018 2.091 2.115 2.241 2.020
    2.009 2.211 2.199 2.281 2.094
    2.782 2.105 2.506 2.660 2.273
    ```

    …and the following series of Vim commands:
  5. csswizardry revised this gist Oct 14, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion explainer.md
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ gg qq j0 :s/⎵/⎵+⎵/g y$ A ⎵=⎵ <C-r>= (<C-r>")/5⏎ <Esc> q @⁠q @@ @@
    * `:s/⎵/⎵+⎵/g`: Substitute every space on the current line for an equals sign
    * `y$`: Yank (copy) from the beginning of the line to the end
    * `A`: Append text onto the end of the current line
    * `⎵=⎵`: Type an = sign
    * `⎵=⎵`: Type an = sign with a space either side
    * `<C-r>=`: Enter the expression resgister (calculator)
    * `(<C-r>")/5⏎`: Put the contents of the pasteboard inside of `(<pasteboard>)/5` and run it
    * `<Esc>`: Leave insert mode
  6. csswizardry revised this gist Oct 14, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion explainer.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ gg qq j0 :s/⎵/⎵+⎵/g y$ A ⎵=⎵ <C-r>= (<C-r>")/5⏎ <Esc> q @⁠q @@ @@
    * `gg`: Jump to the top of the file
    * `qq`: Begin recording a macro into register `q`
    * `j0`: Drop down a line and back to its first character
    * `:s/⎵/⎵+⎵/g`: Substitute every space for an equals sign
    * `:s/⎵/⎵+⎵/g`: Substitute every space on the current line for an equals sign
    * `y$`: Yank (copy) from the beginning of the line to the end
    * `A`: Append text onto the end of the current line
    * `⎵=⎵`: Type an = sign
  7. csswizardry created this gist Oct 14, 2019.
    33 changes: 33 additions & 0 deletions explainer.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    Given the following dataset:

    ```
    Run 1 Run 2 Run 3 Run 4 Run 5
    1.501 + 1.885 + 1.921 + 1.235 + 1.873 = 1.683
    1.991 + 1.871 + 1.885 + 2.007 + 2.114 = 1.9736
    2.018 + 2.091 + 2.115 + 2.241 + 2.020 = 2.097
    2.009 + 2.211 + 2.199 + 2.281 + 2.094 = 2.1588
    2.782 + 2.105 + 2.506 + 2.660 + 2.273 = 2.4652
    ```

    …and the following series of Vim commands:

    ```
    gg qq j0 :s/⎵/⎵+⎵/g y$ A ⎵=⎵ <C-r>= (<C-r>")/5⏎ <Esc> q @⁠q @@ @@ @@ :2,6sort /[=]/⏎
    ```

    * `gg`: Jump to the top of the file
    * `qq`: Begin recording a macro into register `q`
    * `j0`: Drop down a line and back to its first character
    * `:s/⎵/⎵+⎵/g`: Substitute every space for an equals sign
    * `y$`: Yank (copy) from the beginning of the line to the end
    * `A`: Append text onto the end of the current line
    * `⎵=⎵`: Type an = sign
    * `<C-r>=`: Enter the expression resgister (calculator)
    * `(<C-r>")/5⏎`: Put the contents of the pasteboard inside of `(<pasteboard>)/5` and run it
    * `<Esc>`: Leave insert mode
    * `q`: Stop recording macro
    * `@q`: Run macro q on the next line
    * `@@`: Run the last macro (i.e. q) again
    * `@@`: Run the last macro (i.e. q) again
    * `@@`: Run the last macro (i.e. q) again
    * `:2,6sort /[=]/⏎`: Sort lines 2–6 based on the value that appears after the = sign