NOTE This template provides a structured and consistent way to create new checkpoints. Please do your very best to include/use each section of this template.
<!-- Blync meta data -->
In this checkpoint you _________________________.
NOTE This template provides a structured and consistent way to create new checkpoints. Please do your very best to include/use each section of this template.
<!-- Blync meta data -->
In this checkpoint you _________________________.
#Full Stack Rails vs Full Stack JavaScript | |
Aspiring developers often ask “should I learn Rails or JavaScript to become a web developer?” Most students are concerned with picking a language that is easy to learn and that will offer them strong job prospects. Thankfully both Rails and JavaScript are great learning languages and open the door to many job opportunities. | |
##Learning | |
There are many aspects to consider when deciding whether a language is good for learning. Foremost among these is whether the language is beginner friendly, how extensive and support the community and resources are, and whether or not best practices are emphasized. | |
###Beginner Friendly | |
Rails uses the Ruby programming language, which focuses on simplicity and productivity. The creator of Ruby, [Yukihiro Matsumoto](http://en.wikipedia.org/wiki/Yukihiro_Matsumoto), designed it to have an elegant syntax that is natural to read and easy to write. As such, printing out a “Hello world” is as easy as: | |
```ruby | |
puts “Hello world” |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "fedora" |
class VotesController < ApplicationController | |
before_action :load_post_and_vote | |
def update_vote(new_value) | |
if @vote | |
authorize @vote, :update? | |
@vote.update_attribute(:value, new_value) | |
else | |
@vote = current_user.votes.build(value: new_value, post: @post) | |
authorize @vote, :create? |
<div class="row"> | |
<div class="col-md-12"> | |
<div class="row"> | |
<div class="col-md-1"> | |
<div class="row"> | |
<div class="col-mid-6"> | |
</div> | |
<div class="col-mid-6"> | |
</div> | |
</row> |
# Better | |
attribute = "{0}_{1}".format(match_rule.ttype, 'string_start') | |
starts_with = match_rule.__dict__[attribute] | |
# Bad | |
match_rule.__dict__["{0}_{1}".format(match_rule.ttype, 'string_start')] |
Here's what I did to get things working.
Yep, over at: https://developer.apple.com
- Install XCode from the app store. | |
- Install XCode command-line tools. | |
$ xcode-select --install | |
- Install home brew. http://brew.sh/ | |
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
- Install database development packages. | |
$ brew install postgresql |
class ProfilesController < ApplicationController | |
def new | |
@user = User.find(params[:user_id]) | |
@profile = Profile.new | |
end | |
def show | |
@user = User.find(params[:user_id]) | |
@profile = Profile.find(params[:id]) | |
end |
#include <stdio.h> | |
#include <sys/times.h> /* for times system call */ | |
#include <sys/time.h> /* for gettimeofday system call */ | |
#include <unistd.h> | |
/* | |
--------------------------------------------------------------------------- |