day 95 — code 365

Wed 16 Mar 2016

What we did today:

  1. Warmup — Scrabble word scorer
  2. Sinatra — web servers, erb,
  3. Talk — Loretta Cain on Phaser
  4. Homework — Movie Search with Sinatra
  5. Meetup — SydJS

HTML/CSS

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!


label {
cursor: pointer;
}

Ruby

Learnt more things about Ruby:

New methods:

Arrays

  1. char: turns a string into an array of characters
  2. include:
  3. key? includes key?

Sinatra

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:

@result["AAPL"].lastTrade

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.

Talks:

  1. Dungeons & Dragons. Sean Curtis. Using CSS (Flexbox) to filter a huge list of items.
  2. Bitbucket UI components. Marcin Szczenpanski. Sharing UI elements between product interfaces.
  3. Ratcheting your builds. Ian Grunert. Using baseline scores for JS Hint errors to pass / fail builds, and to flag problems.
  4. Automated code mods. Dick Wiggers. A program that searches and updates sections of code, e.g. incorrectly referenced jQuery dependencies.
  5. Performance hacking React. Alex Reardon. Approaches to minimising the number of elements that need re-rendering in the DOM.
  6. Integrating web components with React. Joshua Nelson. An example showing how an inline dialog is implemented in React.
  7. 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!

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.