├── GTD └── Getting Things Done.markdown ├── HTML+CSS └── Introductory HTML and CSS.markdown ├── JavaScript ├── EqualityOfObjectsAndArraysInJavaScript.markdown ├── IntroductoryJSArrayObject.markdown └── PassByReferenceandValue.markdown ├── LICENSE ├── PHP └── Introductory Array Exercises.markdown ├── README.md └── React.js ├── IntroductoryReact.markdown └── WhenDoesReactCallRender.markdown /GTD/Getting Things Done.markdown: -------------------------------------------------------------------------------- 1 | # Getting Things Done 2 | 3 | A good(?) summary video: https://www.youtube.com/watch?v=NnnaJkKdwjU 4 | 5 | - **"Your mind is for having ideas, not holding them."** 6 | - Have a system for remembering other than your brain. Doesn't matter *what* as much as it matters that you trust it, you use it, and it is fast & easy. 7 | - You don't have to worry about forgetting things. 8 | - You can focus on the one task at hand without being distracted by everything else. 9 | - **Have an "inbox" where you can throw all your ideas, immediately, when you have them.** 10 | - I find paper often works best for this, as switching apps tends to be too slow & distracting. 11 | - You may have multiple inboxes (i.e. paper, digital, etc.) 12 | - Email is just an inbox, not a to-do list. 13 | - Don't organize yet, that's distracting. 14 | - **Regularly go through the inbox to put things in their right place:** 15 | - if you can completely take care of it in 2 minutes, just do it 16 | - some stuff is trash 17 | - some stuff you wait for others for or need to be reminded later—calendar alert or similar 18 | - some stuff just needs to be filed for reference 19 | - otherwise, pick the next actionable thing you can do, put it on your to-do list, and file it away 20 | - **Regularly go through the to-do list, and:** 21 | - remove stuff that doesn't matter 22 | - prioritize what needs to be done next 23 | - some things get delegated to a "someday, maybe" list: good ideas, just not now 24 | - **Do stuff!** 25 | - some tasks require a certain location or tools; do them when you are there 26 | - do small tasks when have small time slot, larger tasks when larger 27 | - do hard tasks when you have lots of energy, easy tasks when you don't 28 | - prioritize by importance 29 | 30 | (adapted from the http://joebuhlig.com/getting-things-done-introduction/ series, adapted from David Allen's Getting Things Done) -------------------------------------------------------------------------------- /HTML+CSS/Introductory HTML and CSS.markdown: -------------------------------------------------------------------------------- 1 | # Introductory HTML and CSS 2 | 3 | This document is an attempt to give some of the main background bits to understanding HTML and CSS. It is far from comprehensive, but aims to be approachable and give enough background to understand more complex topics…later. 4 | 5 | ## Server and Browser 6 | 7 | A very basic overview: 8 | 9 | - The browser sends a **request** for a URL to a server. The URL includes a host, a path, and a query string, and the full request includes a set of HTTP headers. 10 | - The request is sent via the HTTP protocol, which sends basically a text file to the server. 11 | - The first part of the file is [**headers**](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields), which have some metadata about the request. 12 | - This includes information about the browser, timestamps, whether it is a GET, POST, or other request, the format the request expects, etc. 13 | - After a blank line, the rest of the file is any **body** of the request that might exist. 14 | - The **response** is sent by the server in much the same format, with the **body** section containing the HTML page or image data or whatever. 15 | - Note that there is no **necessary** correlation between files on disk and the URL. In other words, `http://example.com/important_file.html` could actually retrieve a file on disk called `/stuff/not_important.html`. Further, there may not even be a file on disk that represents the HTML, if you content is being dynamically generated. It's all up to how the HTTP server is configured! 16 | 17 | Example request/response (from [Wikipedia](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Example_session)) 18 | 19 | ### Request 20 | 21 | ``` 22 | GET /index.html HTTP/1.1 23 | Host: www.example.com 24 | ``` 25 | 26 | ### Response 27 | 28 | ``` 29 | HTTP/1.1 200 OK 30 | Date: Mon, 23 May 2005 22:38:34 GMT 31 | Content-Type: text/html; charset=UTF-8 32 | Content-Encoding: UTF-8 33 | Content-Length: 138 34 | Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT 35 | Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux) 36 | ETag: "3f80f-1b6-3e1cb03b" 37 | Accept-Ranges: bytes 38 | Connection: close 39 | 40 | 41 |
42 |text
` or be "self-closing" ``. While the HTML spec is not strict, I'd recommend **closing all tags**, either with a closing tag or by self-closing. 121 | - A few tags cannot have any content, such as the `` might indicate how important the paragraph is). 123 | - Attributes live inside the angle brackets after the tag name, with a label, an equals sign, and a value. 124 | - Some true/false attributes *only* need the label of the attribute. 125 | - Values technically don't need quotes, but it's simpler. Double or single is fine. 126 | - **Text** usually just shows up. It *should* probably be wrapped inside a tag, but doesn't have to be. 127 | - Spaces are collapsed—HTML enforces single spaces between words and sentences. 128 | - Use [HTML entities](https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references) for `<` (`<`) or `>` (`>`). 129 | - Browsers are (somewhat unfortunately) very forgiving and will try guess what tags you *meant* to have. Validation tools are recommended, especially ones built right in to your editor. 130 | 131 | ### Default Styles 132 | 133 | It isn't true for every tag (with the form elements being the most notable exception), but it is often true that the only difference between one tag and another is the default styling that the browser provides. 134 | 135 | (You'll likely want to include [Normalize.css](https://necolas.github.io/normalize.css/) to try make the browser default styles match across browsers. Bootstrap already includes this by default.) 136 | 137 | ### Browser Development Tools 138 | 139 | While all major browser include quality developer's tools, I will focus on [Chrome's DevTools](https://developers.google.com/web/tools/chrome-devtools/). Each browser's tools has their own strengths and weaknesses, and it isn't too uncommon to use more than one set when debugging certain issues. 140 | 141 | - Right-click on a page element and choose "Inspect Element". This will open the dev tools in most browsers, and focus that particular element in the element tree. 142 | - This is a live-updating representation of the HTML on your page, including any changes that JavaScript has made. 143 | - You can see the tree structure of the HTML DOM. 144 | - You can highlight any given element to see information about the CSS rules applied to that node, JavaScript event listeners, and more. 145 | - You can also live-edit the page—though of course your edits don't get saved. (Well, if you are working on something you have access to, there is theoretically a way for the changes to get saved…but I've never set that up.) 146 | - Get applied style information. 147 | - When you have an element focused in the Elements pane, you can look at the currently applied styles. 148 | - This shows **all** styles, organized with the most specific ones at the top, from any location that applies to this element, including the browser's default "user agent stylesheet". 149 | - There is also a graphic showing a bit of the box model, the margin, border, and padding applied to the element. 150 | - Get computed style information. 151 | - Sometimes, even when you see all the applied styles, you just want to know what the **end result** of applying all those styles was. That's what the "Computed" tab is for. 152 | - There is sometimes a disclosure triangle to the left of the properties, allowing you to trace back which CSS rules were used to make this computation. 153 | - [Lots more in the Chrome documentation](https://developer.chrome.com/devtools/docs/elements-styles). 154 | 155 | ### Useful `
` Tags 156 | 157 | Note that the `` tag is has CSS `display: none` by default…but even that can be overridden! 158 | 159 | - `