Install node-repl-promised:
npm install -g repl-promised
Use the repl to list all users
$ node-promised
> var app = require('./app');
undefined
> var Bookshelf = app.get('bookshelf');
undefined
Install node-repl-promised:
npm install -g repl-promised
Use the repl to list all users
$ node-promised
> var app = require('./app');
undefined
> var Bookshelf = app.get('bookshelf');
undefined
Before object oriented programming, there was what's called 'Procedural Programming'. If I wanted to describe the mundane takss of my day to day routine, I could do so using procedures, such as "I wake up. I brush my teeth, etc."
However, we as humans tend to think of everything as an object. This is why languages like Ruby take objects to the extreme by making everything objects. Object oriented programming is good, because it makes thing easier to understand, and easier to extend. I can just include a library and have access to many more objects and methods.
I get into a car, which is an object. I turn on the car, which is a method on the object. Object interacting with each other is what OOP is all about.
Most modern languages are object oriented. Php, Java, Scala, etc.
Some Differences between a Class and an Object
Try Git | Markdown Cheatsheet | Pro Git | Git Config
Getting Started
In the terminal start by creating a new directory, then run git init
to initialize a git repository
<%= f.collection_check_boxes :venue_ids, Venue.all, :id, :name, checked: Venue.all.map(&:id) do |b| %> | |
<span> | |
<%= b.check_box %> | |
<%= b.label %> | |
</span> | |
<% end %> |
Press minus + shift + s
and return
to chop/fold long lines!
.navbar | |
.caret | |
.label | |
.table | |
.img-responsive | |
.img-rounded | |
.img-thumbnail | |
.img-circle | |
.sr-only | |
.lead |
Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.
Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.
class AccountsController < ApplicationController | |
def update | |
@account = Account.find(params[:id]) | |
respond_to do |format| | |
if @account.update_attributes(account_params) | |
format.html { redirect_to @account, notice: 'Account was successfully updated.' } | |
else | |
format.html { render action: "edit" } | |
end |
for (var i=1; i <= 20; i++) | |
{ | |
if (i % 15 == 0) | |
console.log("FizzBuzz"); | |
else if (i % 3 == 0) | |
console.log("Fizz"); | |
else if (i % 5 == 0) | |
console.log("Buzz"); | |
else | |
console.log(i); |