blog.federicomaffei.com

current level - articles for beginners

Day 54.

Not much blogging this week, I know.

But time has come, and I can tell you a bit more about the final project.

Read more...

Day 51.

count = 7
7.times do 
  count -= 1
  puts count
end
puts "Final project!"

All right, week number ten.

Read more...

Day 49.

$.get('/posts/' + postId + '.json', function(post){
            var map = new GMaps({
                div: '#map',
                lat: 0,
                lng: 0
            });

            GMaps.geocode({
                address: post.address,
                callback: function(results, status) {
                    if (status == 'OK') {
                        var latlng = results[0].geometry.location;
                        map.setCenter(latlng.lat(), latlng.lng());
                        map.addMarker({
                            lat: latlng.lat(),
                            lng: latlng.lng()
                        });
                    }
                    else {
                        alert('Could not find address')
                    }
                }
            });
        })

Read more...

Day 48.

<div class="jumbotron">
    <div class='container'>
        <h1>Welcome to Pizzagram.</h1>
        <p>This is a website that includes amazing pictures of pizzas of all flavours. Buonissimo.</p>
        <p><%= link_to 'Sign Up >>', new_user_registration_path, class:"btn btn-primary btn-lg"%></p>
    </div>
</div>

Read more...

Day 47.

class HyperHipsterInstagramUser < ActiveRecord::Base
  has_attached_file :cool_beard_image
  validates_attachment_content_type :cool_beard_image, :content_type => /\Aimage\/.*\Z/
end

Read more...