day 95 — code 365
Wed 16 Mar 2016
What we did today:
- Warmup — Scrabble word scorer
- Sinatra — web servers, erb,
- Talk — Loretta Cain on Phaser
- Homework — Movie Search with Sinatra
- Meetup — SydJS
Figured out how to select the checked value in a group of radio buttons!
var choice = $('input:radio[name=radio-1]').val();
Also figured out how to enable checking of a radio, by clicking its label! This is done by using the id attribute:
<label for="radio-id-1">Radio 1</label>
<input type="radio" id="radio-id-1">
Good to assign a cursor pointer so that users know this is possible!
Learnt more things about Ruby:
- char: turns a string into an array of characters
- key? includes key?
We go introduced to Sinatra today, and the concepts of using a web application framework, a web server, and template pages like layout.erb and inserting sections using yield.
This allowed us to create a (quite unconventional) URL-based calculator using a form!
We used the submit and GET request to make this happen!
This was the first time I was able to use the form element properly! Using the submit functionality!!
We access HTML form elements using the name attribute — think id is for navigation and labels and class is for styling.
We then practiced using Sinatra using the Yahoo Finance gem for a stock-price activity:
gem install yahoofinance
YahooFinance::get_quotes ( YahooFinance::StandardQuote, "AAPL" )
This is a method, that we are passing something into ( standard quote, and Apple)
And then we can store that inside an instance variable: @result
We access @lastTrade like this:
Then… I went to my first meetup — SydJS! This was a bit of an eye-opening experience. There were about 100 people there, a mix of junior and (very) senior developers. Most of the content went completely over my head, and it was both an exciting and sobering experience…
Concepts / terms like: AST (similar to the DOM?), AMD modules for JS, React + Redux, Functional Reactive Programming.
It was pretty inspiring to see / hear people talking about the projects / work they were doing.
- Dungeons & Dragons. Sean Curtis. Using CSS (Flexbox) to filter a huge list of items.
- Bitbucket UI components. Marcin Szczenpanski. Sharing UI elements between product interfaces.
- Ratcheting your builds. Ian Grunert. Using baseline scores for JS Hint errors to pass / fail builds, and to flag problems.
- Automated code mods. Dick Wiggers. A program that searches and updates sections of code, e.g. incorrectly referenced jQuery dependencies.
- Performance hacking React. Alex Reardon. Approaches to minimising the number of elements that need re-rendering in the DOM.
- Integrating web components with React. Joshua Nelson. An example showing how an inline dialog is implemented in React.
- Functional Reactive Programming. Blake Haskell. Example of enabling click and drag functionality using BaconJS and React.
Then, after that, for homework, I really struggled to implement dynamic URLs for the movie search database…
Anyway, thanks for stopping by!