Skip to content

Instantly share code, notes, and snippets.

View jskrwc's full-sized avatar

Jim K jskrwc

  • CA
View GitHub Profile
@jskrwc
jskrwc / SEP-RDF-Installing-and-Using-DB
Created March 19, 2019 00:27
02-Installing and Using relational databases- assignment
library=# SELECT * FROM books;
id | title | author
------+------------------------------------------+---------------------
1259 | Eloquent Ruby | Russell A. Olson
1593 | JavaScript: The Good Parts | Douglas Crockford
8982 | Designing Object-Oriented Software | Rebecca Wirfs-Brock
7265 | Practical Object-Oriented Design in Ruby | Sandi Metz
(4 rows)
@jskrwc
jskrwc / RAILS_CHEATSHEET.md
Created November 13, 2018 07:05 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@jskrwc
jskrwc / ruby_notes.md
Created July 11, 2018 03:11 — forked from aka-rob/ruby_notes.md
Notes from Module 3 - Bloc

Basics

  • puts converts value to string.
  • p does no conversion. Prints the true value.
  • Everything in Ruby is an object!
  • The pound sign/hash is for single line comments.
  • Multiline comments require =begin and =end
  • Integers are whole numbers
  • An expression is a bit of code that yeilds a value.
  • Math can be performed on string objects.
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.2'
@jskrwc
jskrwc / Bloccit-rails-console-assignment
Created February 28, 2018 07:19
Bloccit. Rails-- Assignment 15 --ORM
[18] pry(#<Post>):1>
[19] pry(#<Post>):1> nesting
Nesting status:
--
0. main (Pry top level)
1. #<Post>
[20] pry(#<Post>):1> self.to_s
=> "#<Post:0x007fd802f21f70>"
[21] pry(#<Post>):1> self.title = 'some new title'
=> "some new title"
@jskrwc
jskrwc / gist:233a91091a215cc28a78f2a187a8d9b8
Created February 5, 2018 19:59 — forked from jmtame/gist:6458832
ruby blocks and yield explained by a bloc mentor

The following is an explanation of Ruby blocks and yield by another Bloc mentor (Adam Louis) who was trying to explain it to one of his students.

On my very first day programming, if someone asked me for "the sum of the numbers from 1 to 10", I'd have written:

puts 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10

Easy enough.

@jskrwc
jskrwc / gist:750c61d80233c8ee631453ea8f1dbc89
Created January 15, 2018 04:23
Module-3.1-Ruby-Intro
Test
@jskrwc
jskrwc / player-js-analysis.md
Last active October 2, 2017 06:04 — 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.