- Setup for a new DigitalOcean/AWS EC2/Linode server.
sudo apt-get update
sudo apt-get install htop
sudo apt-get install tmux
sudo apt-get install vim
When you start working with WebPack for GameTime, you'll notice that you can't just define a variable in one file and find it in another as easily as you can in Rails.
Read Node.js, Require and Exports and Organize Your Code with RequireJS
Reference To: Sorting Algorithms in JavaScript
**Respond to this question in your fork: "What are some of the balances and trade offs between different sorting algoritms?"
###COMPARISON:
Bubble Sort | Insertion Sort | Merge Sort | |
---|---|---|---|
Pros | Easy to Implement | Stable sort Good if short on space |
Stable sort Fastest |
Cons | Not Stable sort Slow as eff |
Not good for large data | Need lots of resources to use |
O(n) | O(n2) | O(n2) | O(n log n) |
I can explain the difference between function declarations and function expressions.
I can explain what the value of this
is in a normal function.
I can explain what the value of this
is when called from the context of an object.
I can explain how to explicitly set the value of this
in a function.
The purpose of this tutorial is to mimic setting up a DigitalOcean/AWS EC2/Linode server. The main advantages of having a virtual machine is that you can learn without worry of breaking things.
The first lesson will be all about getting familiar with a headless machine and getting a language we all know and love (ruby). Then we can mess around and try things out purely in the terminal.
The only three good options for a text editor are: emacs, vi, and vim. We will be using vim but vi itself is great and comes by default on Ubuntu 12.04.
Now you can practice getting used to ssh'ing into headless machines, using terminal based text editors, and using a terminal based window/session manager (tmux). The reason we have to use vim and tmux is that there is no X environment in a headless machine (the GUI, graphics, pretty things, etc..). The main reason for this is to save space on precious costly SSD data.
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
What's the total revenue for all items? SELECT SUM(revenue) FROM items;
What's the average revenue for all items? SELECT AVG(revenue) FROM items;
What's the minimum revenue for all items? SELECT MIN(revenue) FROM items;
What's the maximum revenue for all items?
gem 'rails_12factor'
to your Gemfile. This will add error logging and the ability for your app to serve static assets.bundle
RAILS_ENV=production rake db:create db:migrate db:seed
rake secret
and copy the outputexport SECRET_KEY_BASE=output-of-rake-secret
rake assets:precompile
. This will create a folder public/assets
that contains all of your assets.RAILS_ENV=production rails s
and you should see your app.Remember to clobber your assets (rake assets:clobber
) and re-precompile (rake assets:precompile
) if you make changes.