Skip to content

Instantly share code, notes, and snippets.

View GraySmith00's full-sized avatar

Gray Smith GraySmith00

View GitHub Profile
@GraySmith00
GraySmith00 / terminalCheatSheet.textile
Last active May 2, 2018 15:06 — forked from itsmattsoria/gistfil1.textile
Mac Terminal Cheat Sheet

SHORTCUTS

Key/Command Description
Tab Auto-complete files and folder names
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + U Clear the line before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + W Delete the word before the cursor
Ctrl + T Swap the last two characters before the cursor
@GraySmith00
GraySmith00 / array_iteration_thoughts.md
Created April 6, 2018 14:14 — forked from mrmartineau/array_iteration_thoughts.md
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

@GraySmith00
GraySmith00 / git_cheat-sheet.md
Created April 2, 2018 22:20 — forked from davfre/git_cheat-sheet.md
git commandline cheat-sheet