├── LICENSE.md ├── README.md ├── acknowledgements.md ├── courseSections ├── section0.md ├── section1.md ├── section10.md ├── section11.md ├── section12.md ├── section13.md ├── section14.md ├── section15.md ├── section16.md ├── section17.md ├── section2.md ├── section3.md ├── section4.md ├── section5.md ├── section6.md ├── section7.md ├── section8.md └── section9.md ├── images ├── addedRemote.png ├── baseHomepage.png ├── blankHerokuApp.png ├── blankNavbar.png ├── bundleInstall.png ├── c9InitialReadme.png ├── clutteredHomepage.png ├── codeAnywhereInit.png ├── codeAnywhereLandingPage.png ├── codeAnywhereSignup.png ├── colourPalette.png ├── contactWireframe.png ├── containerSetup.png ├── cookieText.png ├── copySSHLink.png ├── createReadme.png ├── editOnGit.png ├── emptyRepo.png ├── fileTree.png ├── finalTree.png ├── finalWireframe.png ├── firstWireframe.png ├── fullLogo.png ├── gitCommit.png ├── gitStatus.png ├── glyphicon.png ├── goodJob.png ├── graph.png ├── herokuCreated.png ├── imageWireframe.png ├── indexErb.png ├── navbarBrand.png ├── navbarTitle.png ├── navigateToCollaborators.png ├── newRepo.png ├── nonRunning.png ├── octocat.png ├── pairProgramming.png ├── repoSetup.png ├── rspecPass.png ├── rvmInstall.png ├── specFolderStructure.png ├── styledHomepage.png ├── tdd.png ├── travisIntegrate.png ├── travisOutput.png ├── travisProfile.png ├── travisSignup.png └── tsPrototype.png ├── navigation.md ├── precourse.md └── tasks ├── task1.md ├── task2.md ├── task3.md ├── task4.md ├── task5.md ├── task6.md └── task7.md /LICENSE.md: -------------------------------------------------------------------------------- 1 | ## creative commons 2 | 3 | # Attribution-NonCommercial 4.0 International 4 | 5 | Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. 6 | 7 | ### Using Creative Commons Public Licenses 8 | 9 | Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. 10 | 11 | * __Considerations for licensors:__ Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors). 12 | 13 | * __Considerations for the public:__ By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees). 14 | 15 | ## Creative Commons Attribution-NonCommercial 4.0 International Public License 16 | 17 | By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. 18 | 19 | ### Section 1 – Definitions. 20 | 21 | a. __Adapted Material__ means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. 22 | 23 | b. __Adapter's License__ means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. 24 | 25 | c. __Copyright and Similar Rights__ means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. 26 | 27 | d. __Effective Technological Measures__ means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. 28 | 29 | e. __Exceptions and Limitations__ means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. 30 | 31 | f. __Licensed Material__ means the artistic or literary work, database, or other material to which the Licensor applied this Public License. 32 | 33 | g. __Licensed Rights__ means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. 34 | 35 | h. __Licensor__ means the individual(s) or entity(ies) granting rights under this Public License. 36 | 37 | i. __NonCommercial__ means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange. 38 | 39 | j. __Share__ means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. 40 | 41 | k. __Sui Generis Database Rights__ means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. 42 | 43 | l. __You__ means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. 44 | 45 | ### Section 2 – Scope. 46 | 47 | a. ___License grant.___ 48 | 49 | 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: 50 | 51 | A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and 52 | 53 | B. produce, reproduce, and Share Adapted Material for NonCommercial purposes only. 54 | 55 | 2. __Exceptions and Limitations.__ For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 56 | 57 | 3. __Term.__ The term of this Public License is specified in Section 6(a). 58 | 59 | 4. __Media and formats; technical modifications allowed.__ The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. 60 | 61 | 5. __Downstream recipients.__ 62 | 63 | A. __Offer from the Licensor – Licensed Material.__ Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. 64 | 65 | B. __No downstream restrictions.__ You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 66 | 67 | 6. __No endorsement.__ Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). 68 | 69 | b. ___Other rights.___ 70 | 71 | 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 72 | 73 | 2. Patent and trademark rights are not licensed under this Public License. 74 | 75 | 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes. 76 | 77 | ### Section 3 – License Conditions. 78 | 79 | Your exercise of the Licensed Rights is expressly made subject to the following conditions. 80 | 81 | a. ___Attribution.___ 82 | 83 | 1. If You Share the Licensed Material (including in modified form), You must: 84 | 85 | A. retain the following if it is supplied by the Licensor with the Licensed Material: 86 | 87 | i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); 88 | 89 | ii. a copyright notice; 90 | 91 | iii. a notice that refers to this Public License; 92 | 93 | iv. a notice that refers to the disclaimer of warranties; 94 | 95 | v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; 96 | 97 | B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and 98 | 99 | C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 100 | 101 | 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 102 | 103 | 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 104 | 105 | 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. 106 | 107 | ### Section 4 – Sui Generis Database Rights. 108 | 109 | Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: 110 | 111 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only; 112 | 113 | b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and 114 | 115 | c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. 116 | 117 | For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. 118 | 119 | ### Section 5 – Disclaimer of Warranties and Limitation of Liability. 120 | 121 | a. __Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.__ 122 | 123 | b. __To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.__ 124 | 125 | c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. 126 | 127 | ### Section 6 – Term and Termination. 128 | 129 | a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. 130 | 131 | b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 132 | 133 | 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 134 | 135 | 2. upon express reinstatement by the Licensor. 136 | 137 | For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. 138 | 139 | c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. 140 | 141 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. 142 | 143 | ### Section 7 – Other Terms and Conditions. 144 | 145 | a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. 146 | 147 | b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. 148 | 149 | ### Section 8 – Interpretation. 150 | 151 | a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. 152 | 153 | b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. 154 | 155 | c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. 156 | 157 | d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. 158 | 159 | > Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. 160 | > 161 | > Creative Commons may be contacted at creativecommons.org 162 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | A day as a Developer 2 | ==================== 3 | 4 | [:globe_with_meridians: Go to course navigation :globe_with_meridians:](./navigation.md) 5 | 6 | What is this all about? 7 | ---------------------- 8 | 9 | As an agile team member working in tech you have the fortune/misfortune to work with developers. We try to work using agile methodologies and this includes the concept of the cross-functional team. This is about the big picture. A team has a goal that it needs to achieve, how it gets there should be the preserve of the team and this should not be hampered by job titles and/or narrow working silos. Having a common level of understanding and a common language across the team can help to break down these silos creating a highly performing team. 10 | 11 | Now when it comes to obscure language and weird acronyms, I have to admit, developers need to shoulder much of the blame. So think of this course as a tortuous apology and, as the quickest way to learn something is to do it, you will now get to spend the next day as a developer. 12 | 13 | So how do you "be a developer". The truth is that the job requires a broad range of skills and the willingness to dive into something that you know almost nothing about, learn it, use that knowledge to fix your current problem and then find another problem and do it all again. It's about leveraging a large range of skills, technologies and languages putting them all together and making things that work, even when it is particularly bewildering. That's the ideal anyway. 14 | 15 | This course is designed to mimic this process in a structured way. The first half will walk you through key concepts and provide some foundational knowledge. As we move on things will start to get a little harder, there will be fewer explicit answers and you will need to find and provide your own solutions. Hopefully, it will push you out of your comfort zone while teaching you a few new things along the way. 16 | 17 | Let's begin! 18 | 19 | Precourse and Setup 20 | ------------------ 21 | 22 | Prior to this course you should have completed everything in the [Precourse Setup Section :arrow_forward:](./precourse.md) 23 | 24 | Before moving forward please ensure that you have all the accounts required. 25 | 26 | How to follow this Course 27 | ------------------------ 28 | 29 | Nothing in the course is designed as a trap. If you follow the material you should end the day with a working Minimum Viable Product website that can be deployed for the rest of the world to see! There are only two rules: 30 | 31 | - **Type every line of code yourself.** While it can seem faster to copy and paste it stops you from learning what's going on. 32 | - **You don't need to understand everything.** Understanding is vital but so is managing how much you need to know - there is only so much time in the day and we want to have a working website at the end of this particular day. It isn't possible to understand everything. 33 | 34 | What do I do if I get stuck 35 | --------------------------- 36 | 37 | One of the first problems to overcome as a developer is getting stuck. It's a tricky one because getting stuck sucks especially when you have no idea how to get unstuck. The good news is that all developers have been there so the following guidelines provide a handrail to follow throughout the day when you face a problem and can't seem to find a way out. 38 | 39 | 1. Try to work out what is actually going on. It sounds patronising but if you can describe the problem you have an idea of what's blocking you. Even if it is in vague terms if you then need to seek help you can at the very least describe the problem accurately. 40 | 2. Talk everything through with your pair partner, bounce ideas off each other. Take a quick break and then approach the problem again as though it is the first time you have encountered it. 41 | 3. Throughout the preceding steps try to gather keywords that relate to the problem like, 'Array' or 'Terminal'. 42 | 4. Isolate error keywords. If you have an error message, identify and add these keywords to your results from (3). 43 | 5. Google! Research the problem using your keywords. Also use the keywords to indentify relevant results (i.e. not just the first one). 44 | 6. Other pairs of Developers. Take your well-described, well formatted question to another developer or pair of developers; they may have encountered the same problem and know how to solve it. 45 | 7. Coach/Senior Developer. If all else fails take your question all the way to the top. Don't be disappointed though if the answer comes as more questions. 46 | 47 | :blue_book: Consider bookmarking this page for quick reference as you go through the course. 48 | 49 | Start Developing 50 | ---------------- 51 | 52 | When you're ready click the link to navigate to [the first section :arrow_forward:](./courseSections/section0.md) 53 | 54 | --------------- 55 | [:tada: Acknowledgements :tada:](./acknowledgements.md) 56 | -------------------------------------------------------------------------------- /acknowledgements.md: -------------------------------------------------------------------------------- 1 | Acknowledgements and attribution 2 | ================================ 3 | 4 | [:globe_with_meridians: Go to course navigation :globe_with_meridians:](./navigation.md) 5 | 6 | This course is heavily based on the [Build a Website :link:](https://github.com/makersacademy/build-a-website) project and uses a similar style of teaching to that propagated by the phenomenal [Makers Academy :link:](http://www.makersacademy.com/). If you don't know anything about Makers then do take a look it is an awesome organisation. 7 | 8 | The logo for the prototype website was made by [Freepik :link:](http://www.freepik.com) and was made available through [www.flaticon.com :link:](http://www.flaticon.com) - a great resource 9 | -------------------------------------------------------------------------------- /courseSections/section0.md: -------------------------------------------------------------------------------- 1 | Pair Programming 2 | ================ 3 | 4 | [:globe_with_meridians: Go to course navigation :globe_with_meridians:](../navigation.md) 5 | 6 | Throughout this course you will be working in pairs to try and build a prototype website. Working in pairs is not just something to help us learn on this course it is also a fundamental skill used by many developers to improve their code quality, pace of learning and make a few friends along the way. 7 | 8 |  9 | 10 | Pair programming is the process whereby two people actively collaborate on developing code. Used as part of a general teamwork approach it leads to improved code quality, team communication, knowledge share and huge learning gains. Not suprisingly, [Large scale studies of computer science students :link:](http://www.cs.pomona.edu/classes/cs121/supp/williams_prpgm.pdf) have shown greatly improved outcomes when students pair program on coding problems. 11 | 12 | How to 13 | ------ 14 | 15 | While there are many styles of pair programming we will be using a common driver :red_car: navigator :loudspeaker: style here. 16 | 17 | The key component of pair programming is regular driver/navigator switching :twisted_rightwards_arrows:. When pair programming, at any one time, one person should be the driver, i.e. the person actually typing, while the other pair should be the navigator. The navigator's role is to try and think more broadly about where the code is going; to act as a sounding board to the driver and to offer suggestions on architectural design or to be looking up documentation related to the task at hand. The navigator should avoid constantly mentioning spelling mistakes and other typos unless the driver is really stuck. 18 | 19 | It's absolutely critical that you swap driver and navigator roles frequently - probably at least once every 15 minutes. If one person carries on driving for the whole session both parties learning and code quality will be impaired. Whether you are extrovert or introvert, driver or navigator it is the responsibility of both of you to rotate roles. Don't be a keyboard hog! 20 | 21 | Pair programming can be very exhausting as it will often lead to a state of very highly focused concentration. Make sure you take occasional breaks (at least every 90 minutes), and remember that learning how to effectively pair with individuals from all backgrounds and personality types is at least as important as any individual coding skills. 22 | 23 | To prod you into good practices wherever you see a :twisted_rightwards_arrows: you should think about switching roles. 24 | 25 | General Pair Programming Do's and Don'ts 26 | -------------------------------------- 27 | 28 | **Do's:** 29 | - Before you begin, check in with each other about your energy levels, moods and working styles. 30 | - Talk 31 | - Listen 32 | - Rotate roles 33 | - Be patient 34 | - Respect each other 35 | - Take breaks 36 | - Prepare for the session 37 | - Take care of personal hygiene 38 | - Have fun 39 | 40 | **Don'ts:** 41 | - Be bossy 42 | - Be intimidated 43 | - Be quiet 44 | - Suffer in silence 45 | 46 | ------------ 47 | 48 | [:arrow_backward: Previous page](../README.md) | [Continue to the next section :arrow_forward:](./section1.md) 49 | -------------------------------------------------------------------------------- /courseSections/section1.md: -------------------------------------------------------------------------------- 1 | Development Environment 2 | ======================= 3 | 4 | [:globe_with_meridians: Go to course navigation :globe_with_meridians:](../navigation.md) 5 | 6 | Developers generally work closer to the bare bones of the computer than your average user. That means lots of time in the 'command line' and not relying on 'GUI' (Graphical User Interface) tools. However, to get your computer setup for web development is a art in and of itself- especially on Windows. 7 | 8 | Fortunately, there are a number of cloud based development environments available that provide almost identical experience but with everything ready for you out of the box. For this course we will be using CodeAnywhere. 9 | 10 | Getting Started 11 | --------------- 12 | 13 | Choose who is going to be the driver and the navigator to begin with and follow the steps below on the driver's laptop. 14 | 15 | 1. [Navigate to the CodeAnywhere account you created earlier :link:](https://codeanywhere.com/editor/) - After some loading time you should see the following page: 16 | 17 |  18 | 19 | 2. We will be creating a workspace that is preconfigured to have almost everything we need to get going. With that in mind select `Container` from the menu on the left side of the connection wizard. 20 | 21 | 3. In the `Name` field enter your projects name. As we will be creating a prototype website you could perhaps go with the imaginative name: `prototypeWebsite`?! 22 | 23 | 4. Scroll through the environment options in the centre of the pane until you get to the `Ruby` options and then the `Ubuntu` environment as shown below: 24 | 25 |  26 | 27 | 5. Now click `Create`! 28 | 29 | After a little bit of work, your environment should be created for you and you should arrive on a landing page with some helpful information about the container you have just created in the cloud (Don't worry too much for the moment what a container or the cloud actually are). 30 | 31 |  32 | 33 | What you are seeing in this image is an **Integrated Development Environment (IDE)**. IDEs are highly complex applications and take a bit of getting used to. Think Microsoft Word, on steroids, exposed to radiation in a secret nuclear incident and having gained super powers...something like that. Regardless, the important thing is that CodeAnywhere gives us the four critical components of our development environment: 34 | 35 | - A **file system** to store our source files (code, images, HTML, CSS and others) 36 | - An **editor** to edit the above mentioned source files 37 | - An **operating system** to run the program described by these files 38 | - Finally, a **command line** or **terminal** to send instructions to the operating system 39 | 40 | Creating a README 41 | ----------------- 42 | 43 | It's a convention of all good projects to have a README file that explains what the project is for and provides information about how to install and run the program. Right click on the `prototypeWebsite` container icon under `Connections` in the tree view to the left of the screen. Select `Create File` and enter the name `README.md`. 44 | 45 |  46 | 47 | Once created the file should open in editing pane and also show up in the tree view to the left of the screen. The file has a `.md` extension, which means it is intended to be written in **Markdown** a popular syntax for lightly styling text files. Markdown is ubiquitous on **Github** [and here is a useful guide to it :link:](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). For now though, let's just create a basic placeholder for our information. 48 | 49 | Type the following into our newly created file (those are equal signs under the title): 50 | 51 | ``` 52 | Prototype Website 53 | ================= 54 | 55 | Built by [Your names here] 56 | ``` 57 | 58 | Introducing Ruby 59 | --------------- 60 | 61 | Ruby is a [programming language :link:](http://www.webopedia.com/TERM/P/programming_language.html). That is to say that it is a formal computer language designed to communicate instructions to a machine, particularly a computer. It is also interpreted. As an aside: languages broadly fall into two catagories: interpreted and compiled. Interpreted languages are read by a program and converted into machine code when they are run whereas compiled langagues are converted into machine code by a compiler. This produces a file that can then be run. This may sound like an exercise in semantics but the point is that different languages have different properties that make them particularly suited to certain tasks. 62 | 63 | Ruby as a language is perfect for our needs and importantly it comes pre-installed on your CodeAnywhere workspace. To test this, go to the command line and type (don't include the `$`) 64 | 65 | > The command line should be the first tab open in your editor pane. 66 | 67 | ``` 68 | $ ruby -v 69 | ``` 70 | (...then hit return to enter it) and you should see something like this: 71 | 72 | ``` 73 | ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux] 74 | ``` 75 | 76 | > We'll use the `$` sign to represent the command line prompt and to differentiate commands you should enter from the output you should see. 77 | 78 | This tells us the currently installed version of Ruby (which we requested by passing the `-v` to the `ruby` command). 79 | 80 | Updating our Ruby Version 81 | ------------------------- 82 | 83 | Before we go ahead, we need to ensure that the version of ruby we are running is updated so that some of the newer features we'll experiment with during the day will work. 84 | 85 | For this we'll use another tool that comes preinstalled with CodeAnywhere called `rvm` short for Ruby Version Manager which is just a program for controlling the version of the Ruby language that you are running. 86 | 87 | Go back to the command line and run the following commands one after another: 88 | 89 | ``` 90 | $ rvm install 2.4.2 91 | ``` 92 | 93 | This should produce an output that looks a little like this: 94 | 95 |  96 | 97 | Once this has finished installing we can then tell our environment to use this installed version as follows: 98 | 99 | ``` 100 | $ rvm use --default 2.4.2 101 | ``` 102 | 103 | If you then run: 104 | 105 | ``` 106 | $ ruby -v 107 | ``` 108 | 109 | You should see that the output has changed to show that we are now using our newly installed version: 110 | 111 | ``` 112 | ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux] 113 | ``` 114 | 115 | Writing a Ruby Program 116 | ---------------------- 117 | 118 | Create a file in your workspace called `hello.rb`. By convention, Ruby files have the extension `.rb`. The benefit of this convention is that CodeAnywhere will provide Ruby **syntax highlighting** for all files with the `.rb` extension. 119 | 120 | Open the file in the editor and add the following content: 121 | 122 | ```ruby 123 | puts 'Hello Ruby' 124 | ``` 125 | 126 | See how syntax highlighting works? The IDE recognises the Ruby language and uses colours to differentiate elements of the 'grammar'. You may see different colours depending on your chosen theme. 127 | 128 | Save the file. Now go to the command line and enter the following: 129 | 130 | ``` 131 | $ ruby hello.rb 132 | ``` 133 | 134 | This tells the Ruby engine to run the code in the `hello.rb` file. You should see the following output: 135 | 136 | ``` 137 | Hello Ruby 138 | ``` 139 | 140 | You've just written a command-line program: you run it from the command line and it outputs to the command line! 141 | 142 | --------- 143 | 144 | :twisted_rightwards_arrows: At this point let's do our first switchover (staying on the same laptop) and move onto the next section. 145 | 146 | -------- 147 | [:arrow_backward: Previous section](./section0.md) | [Continue to the next section :arrow_forward:](./section2.md) 148 | 149 | -------------------------------------------------------------------------------- /courseSections/section10.md: -------------------------------------------------------------------------------- 1 | Adding Your Own Style 2 | ====================== 3 | 4 | [:globe_with_meridians: Go to course navigation :globe_with_meridians:](../navigation.md) 5 | 6 | Previously we added some content using the Bootstrap framework and some of you were hopefully wondering what was being provided behind the scenes and how our website was already looking a little...styled? To put everything into perspective: so far we've written a little Ruby (telling our computer what to do and what to check for), a little HTML (decribing the structure of the content we want for our page) and now we come to CSS. 7 | 8 | CSS (more formally Cascading Style Sheets) is the technology we use to define the *layout* and *design* of the HTML *structure* we have already written. Without CSS our webpages would just be a load of left-justified, black-text-on-white-background monstrosities. 9 | 10 | Bootstrap will take us a long way, particularly when it comes to our page layout and scaling across different devices, but it still leaves a little to be desired in the looks department. So let's get under the hood and add our own styling to take our site to the next level. 11 | 12 | Making our homepage pretty 13 | -------------------------- 14 | 15 | Following a quick show-and-tell with our product owner they remarked that while they were impressed with your rapid prototyping ability they thought that the page looked a little bland. Thankfully they had just a the thing: a handy colour palette for us to brighten up the site and a user story to describe the work to be completed. 16 | 17 | ``` 18 | As a prototypical business owner 19 | I want my site to be decked out in prototypical colours 20 | So that my eyes are soothed every time I open my web-browser 21 | ``` 22 | 23 |  24 | 25 | Inline styling 26 | -------------- 27 | 28 | Before we get down into the weeds we'll start with some of the basics. 29 | 30 | To style our page we can add some CSS directly to our `index.erb` file by adding the `style` attribute to the HTML tag that you want to apply it to. 31 | 32 | So for example, try the following in `index.erb` 33 | 34 | ```html 35 |
36 | ... 37 | 38 | ``` 39 | 40 | How red does your page look now?! 41 | 42 | The CSS we just added tells the browser to render the body of our page - i.e everything that's visible on the screen - with the specified background colour. Once upon a time, all CSS was added directly inline with the HTML like this. However, as with our ruby code this is going to be difficult to read and maintain. We want to put all of our styles in a separate file (or files) and keep our code DRY. As an aside the DRY principle (Don't repeat yourself) is key to being a developer. Essentially Duplication is waste and is likely to lead to code and processes that are harder to understand and much more error prone. Duplication of logic (which we are dealing with here) should be eliminated by abstraction while duplication of processes should be eliminated by automation (Hopefully this chimes with a few of the ideas we talked about with testing). 43 | 44 | > Have a think about the many tasks that you do repetitively day in day out - could any of these be automated? If so how? If you can answer those questions maybe there's a startup in the making! 45 | 46 | If you would like to know more about DRY and other key principles that guide software development then have a read of this article on the aptly named [Giant Robots Smashing into Other Giant Robots Blog :link:](https://robots.thoughtbot.com/back-to-basics-solid). 47 | 48 | Creating our own CSS 49 | -------------------- 50 | 51 | Remove the inline style that we added in the last step so that you are left with ` ... `. Now create a `public` folder in your CodeAnywhere workspace and then add a `css` folder inside `public`. Finally create a file called `application.css` inside the `css` folder. At the end your file tree should look a little like this: 52 | 53 |  54 | 55 | Let's firstly normalise the background colour to be in line with the colour palette we've been given. Add the following: 56 | 57 | ```css 58 | body { 59 | background-color: #FAF9F9; 60 | } 61 | ``` 62 | 63 | You can interpret this CSS code as being the following instruction to the browser: *render* any `` *element* on the page using the background colour with the Hex value `#FAF9F9`. In the case of `body` there should only ever be one on the page. But if you were refering to paragraph elements: `` there could be many spread across the page. 64 | 65 | Refresh your preview. Did it work (admittedly comparing two shades of white can be hard)? Did you expect it to work? It doesn't matter whether you were right or wrong - what matters is how you use that outcome to progress. Take a few moments to consider the changes we just made and how they might have affected the outcome. 66 | 67 | The answer is that the browser doesn't know anything about `public/css/application.css`. Why would it? It's our responsiblity to tell the browser about this external stylesheet. Fortuantely, that's another fundamental part of the way the web works. In fact you've already done it once before! 68 | 69 | In the same way we had to tell our html in `index.erb` to use the bootstrap CSS framework we now need to tell it to also pull in our newly created `application.css`. 70 | 71 | Update your `
...` section to include the following: 72 | 73 | ```html 74 | 75 | ``` 76 | 77 | Notice how our `href` is in this case pointing to our local file rather than a remote url and that we don't need to add the `public`. Make sure your `index.erb` file is saved and then switch over to your blank `application.css`. 78 | 79 | Now refresh your browser. The background should be *Snow* coloured. 80 | 81 | That's probably not the most exciting change you've ever seen (if you can even see the change) so let's start fleshing things out with a bit of styling to our `jumbotron` element. Add the following to `application.css`. 82 | 83 | ```css 84 | .jumbotron { 85 | margin-top: 5em; 86 | background-color: #FAF9F9; 87 | border: solid 2px #BEE3BD; 88 | color: #555B6E; 89 | } 90 | ``` 91 | 92 | > Why do you think we've described the jumbotron using `.jumbotron` in our css file? If you're struggling then maybe [this will help :link:](https://www.w3schools.com/cssref/sel_class.asp). 93 | 94 | Now if you refresh your browser you should see a nicely outlined jumbotron more centrally positioned on our homepage with text in *Black Coral*. Exciting stuff!!! 95 | 96 | Task 5 97 | ------ 98 | 99 | :twisted_rightwards_arrows: 100 | 101 | - [ ] Our work on the current user story is not complete. Our navbar is still looking distinctly "off brand". Style the navbar to bring it inline with the rest of our site and the colour palette. Feel free to go rogue and change the colors and values we've used in our CSS so far. The goal is consitency, but do add a bit of your own flare if you'd like. 102 | 103 | - [ ] *Bonus Task* - Add a custom font and update the `application.css` to style our `` element to use it. [Google fonts is a great source :link:](https://fonts.google.com/) 104 | 105 | -------------- 106 | 107 | [:arrow_backward: Return to previous section](../courseSections/section9.md) | [Continue to the Answers :arrow_forward:](../tasks/task5.md) 108 | -------------------------------------------------------------------------------- /courseSections/section11.md: -------------------------------------------------------------------------------- 1 | Making Things Happen With JavaScript 2 | ==================================== 3 | 4 | [:globe_with_meridians: Go to course navigation :globe_with_meridians:](../navigation.md) 5 | 6 | While our website is now an explosion of colour there's nothing dynamic about it. We're going to change that now using JavaScript. JavaScript is not just another programming language. Unlike Ruby which runs on the server JavaScript *runs in the browser*. that might not mean much right now, but it's a game changer! It means that we can load code into our pages from various sources - not just our own server - and have it run independently on the client's machine. 7 | 8 | If you think that sounds potentially dangerous, you are right. A large number of Internet security vulnerabilites involve JavaScript. However, without JavaScript, the web would be a much duller place. 9 | 10 | As with our Ruby and CSS code we'll be using a framework to help us along the way. In this instance the popular [JQuery :link:](https://jquery.com/) Library. 11 | 12 | As with our other frameworks we need to tell our application to load JQuery so that it's ready for our use. 13 | 14 | Add the following line just before your closing `` element in your `index.erb`. 15 | 16 | ```html 17 | 18 | ``` 19 | 20 | Loading JQuery into the page won't by itself do anything. For that we need to write our own Javascript to interact with it and the page. Let's begin by creating a folder `public/javascript` and within that create a file called `app.js`. 21 | 22 | Once complete you should be left with the following file structure: 23 | 24 |  25 | 26 | Now as with our JQuery library we need to add our `app.js` to the page with the following line again just before your closing `