- Generate a new Rails app
rails new [APP-NAME] -T -d postgresql --skip-turbolinks
- Make an initial commit
cd [APP-NAME]
#Creating an app called my_great_app | |
rails new my_great_app -T -d postgresql --skip-turbolinks | |
cd my_great_app | |
git init | |
git add . | |
git commit -m "Initial commit. Rails boilerplate." | |
# Edit gemfile | |
# #Remove the reference to coffee-rails. |
const Timeline = React.createClass({ | |
getInitialState: function() { | |
return { tweets: [] }; | |
}, | |
componentDidMount: function() { | |
this.fetchTweets(); | |
}, | |
fetchTweets: function() { |
class Timeline extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
tweets: [] | |
}; | |
this.fetchTweets = this.fetchTweets.bind(this); | |
} | |
componentDidMount() { |
class Timeline << React::Component { | |
def initialize(props) { | |
super(props) | |
@state = { tweets: [] } | |
} | |
def component_did_mount() { | |
self.fetchTweets(); | |
} |
require 'open-uri' | |
require 'json' | |
require 'pry' | |
# THE ADDRESS ON THE INTERNET YOU WANT TO FETCH DATA FROM | |
BASE_URL = "https://data.cityofnewyork.us/resource/uvbq-3m68.json" | |
# GET USER INPUT TO MAKE IT DYNAMIC | |
puts 'What is the license plate number you want to search for?' | |
user_input = gets.chomp |
require 'pry' | |
class GumballMachineTerminalView | |
def initialize | |
end | |
def welcome_message | |
puts "Welcome to the Squirrel's Gumball Machine" | |
end |
var numbers = [1, 2, 3]; | |
numbers.forEach(function(num, index, array) { | |
console.log('I am ' + num) | |
}) | |
var doubledNumbers = numbers.map(function(num) { | |
return num * 2 | |
}); |
numbers = [1,2,3] | |
numbers.each do |num| | |
puts "I am #{num}" | |
end | |
double_numbers = numbers.map do |num| | |
num * 2 | |
end |