SourceTrack
-
Wish-I-Hads
-
High
-
Low
-
Looking forward to
SourceTrack
Wish-I-Hads
High
Low
Looking forward to
SourceTrack
Wish-I-Hads
High
Low
Looking forward to
| def turing_transform(person) | |
| 4.times do | |
| person.destroy_confidence | |
| person.teach_some_stuff | |
| person.take_lots_of_money | |
| person.reduce_melanin | |
| person.throw_a_little_morsel_of_confidence | |
| person.make_some_great_friends | |
| end | |
| person |
| def top_3_words(text) | |
| sterilized_words(text).reduce({}, &count_words) | |
| .sort_by(&by_count).map(&first).reverse.take(3) | |
| end | |
| def count_words | |
| lambda do |result, word| | |
| result[word] = (result[word] || 0) + 1 ; | |
| result | |
| end |
adder = Proc.new { |arg1, arg2| arg1 + arg2 }Procs in Ruby are like anonymous functions. In other words, little packages of code (defined in blocks of {} or do..end) that can be passed around as an object.
Proc is actually short for procedure, so when you pass a Proc as an argument to a method, you can think of it as giving the method a list of instructions, as opposed to a particular data structure or value.
| // Source: https://github.com/tmikeschu/the-spoken-tour | |
| // ContactForm.jsx | |
| import React, { Component } from "react" | |
| import APIService from "../../APIService/APIService" | |
| const apiService = new APIService("https://spoken-api.herokuapp.com") | |
| export default class ContactForm extends Component { | |
| constructor(props) { |
| // src/App/About/About.jsx | |
| import React, { Component } from 'react' | |
| export default class About extends Component { | |
| render() { | |
| return ( | |
| <article className="about"> | |
| <section className="who"> | |
| <h2>Who</h2> |
| // src/App/About/About.jsx | |
| import React from 'react' | |
| const About = () => ( | |
| <article className="about"> | |
| <section className="who"> | |
| <h2>Who</h2> | |
| <p>We are a pair of lunatics who...</p> | |
| </section> |