Skip to content

Instantly share code, notes, and snippets.

View CRomano31415's full-sized avatar
🌴
On vacation

Claudia R CRomano31415

🌴
On vacation
View GitHub Profile
@CRomano31415
CRomano31415 / index.md
Created October 6, 2018 17:37 — forked from rstacruz/index.md
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

pry(#<Post>):1> nesting
Nesting status:
--
0. main (Pry top level)
1. #<Post>
[5] pry(#<Post>):1> self.to_s
=> "#<Post:0x007fcd8f8dfbd0>"
[6] pry(#<Post>):1> self.title = 'some new title'
=> "some new title"
[7] pry(#<Post>):1> self.body = 'some new body'
@CRomano31415
CRomano31415 / player-js-analysis.md
Last active October 15, 2017 19:56 — forked from R-V-S/player-js-analysis.md
player.js analysis
  1. This file declares a class, Player, instantiates it, and assigns it to a global player variable.
  2. The Player class contains four methods:
    • constructor()
    • playPause()
    • skipTo()
    • setVolume()
  3. The constructor() method sets initial values for the currentlyPlaying, playState, volume, and soundObject properties.
    • currentlyPlaying is set to the first item in album.songs.
    • The initial playState is "stopped".
  • The volume is set to the number 80.