Skip to content

Instantly share code, notes, and snippets.

@mbattur
mbattur / gist:22cbe7ae2ece6caa65c6
Last active November 2, 2015 19:28
2015.09.21 - Notes
Strings and numbers are known as primitive data types. Primitive data types are basically the smallest building blocks for Ruby programs. In the next exercise, you'll work with more building blocks.
Booleans are a primitive data type, just like Strings and Numbers. Booleans can have one of two values: true or false.
There's one more primitive data type to explore before moving on: the Symbol. Symbols are like strings, only with less functionality. A Symbol is designated with a colon (:) to the left of a word. Symbols can contain any alpha-numeric character, but they must start with a letter.
While "hello" + 3 doesn't make sense, you can mix strings and numbers if the return is meant to be a string. Combining strings and numbers is called string interpolation. String interpolation is the act of inserting a non-string value into a String, thus creating a new String. Interpolation is accomplished with the #{ } syntax.
The modulo operator – % – returns the integer remainder of a quotient. For example, when d
[16] pry(#<Post>):1> self
=> #<Post:0x000000039e3d08
id: 1,
title: "my new title",
body: "my new body",
created_at: Tue, 13 Oct 2015 21:49:28 UTC +00:00,
updated_at: Wed, 14 Oct 2015 21:26:30 UTC +00:00>
$ heroku login
$ heroku create
$ git push heroku master
WITH DESCRIPTION
Deploying to Heroku
It is time to deploy and share your app with the world. There are many choices for deploying and hosting Rails applications, and Bloc recommends the popular Heroku platform. Heroku makes it easy to manage and deploy Rails apps using the command line.
Before Each Checkpoint
$ git status
$ git checkout -b checkpoint-23-interfaces
Switched to a new branch 'checkpoint-23-interfaces'
After Each Checkpoint
$ git status
$ git add .
$ git status
$ git commit -m "Checkpoint 23 completed, interfaces"
$ alias rs="rails s -p $PORT -b $IP"
$ rs
https://js-foundation-mbattur.c9users.io:8080/
jekyll serve --host $IP --port $PORT --baseurl ''
git remote -v
$ git push heroku master
$ heroku run rake db:migrate
repl.it - an online, interactive Ruby shell. It is a full-feature terminal emulator that lets you experiment with and execute Ruby code.
https://repl.it/languages/Ruby
The list of keyboard shortcuts can be found in the NetBeans Wiki.
Turn On/Off Search Result highlights
Alt + Shift + H
Add/remove comment. Should work for all languages
Ctrl + / or in mac ⌘ + /
cd blocipedia
ls -la
cd log
ls -la
tail test.log
tail -f test.log
Rails.logger.info