turingschool / curriculum Goto Github PK
View Code? Open in Web Editor NEWTuring's main repository of tutorials and projects
Turing's main repository of tutorials and projects
The screen.css link in the Blogger project is not accessible:
Styling
This is not a CSS project, so to make it a bit more fun we’ve prepared a CSS file you can drop in. It should match up with all the example HTML in the tutorial.
Download the file from http://tutorials.jumpstartlab.com/assets/blogger/screen.css and place it in your app/assets/stylesheets/ folder. It will be automatically picked up by your project.
The link http://tutorials.jumpstartlab.com/assets/jsblogger/screen.css fetches the appropriate css. Perhaps this file wasn't migrated when the project was renamed from jsblogger? The file does exist on the master branch at public/assets/blogger/screen.css.
Talk about markdown filters and such in the haml lesson
I am a complete noobie to Ruby (and GitHub for that matter). So if this comment is of no value, or if this issue is solely the result of my ignorance, please forgive me.
I just began working through Event Manager tutorial, and am at the "Iteration: 0" section. I found that running the following code:
# Dependencies
require "csv"
# Class Definition
class EventManager
def initialize
puts "EventManager Initialized."
filename = "event_attendees.csv"
@file = CSV.open(filename)
end
end
# Script
manager = EventManager.new
Gives me the following error:
/home/justin/Documents/Code/event_manager/event_manager.rb:9:in `open': wrong number of arguments (1 for 2) (ArgumentError)
from /home/justin/Documents/Code/event_manager/event_manager.rb:9:in `initialize'
from /home/justin/Documents/Code/event_manager/event_manager.rb:14:in `new'
from /home/justin/Documents/Code/event_manager/event_manager.rb:14
EventManager Initialized.
[Finished]
But when I add the optional argument mode = 'rb'
to CSV.open(filename)
like this:
# Dependencies
require "csv"
# Class Definition
class EventManager
def initialize
puts "EventManager Initialized."
filename = "event_attendees.csv"
@file = CSV.open(filename, mode = 'rb')
end
end
# Script
manager = EventManager.new
Then I get no errors:
EventManager Initialized.
[Finished]
I had to stare for awhile at the CSV.open
method specification and tried the mode
argument on a whim (I have the vague sense it has something to do with encoding). Would it be useful to include mode = 'rb'
in the example code?
Best,
jb
ps - is this an overkill description?
@jimweirich is working with JSBlogger this week and had these revision suggestions:
Most people use SCSS because it's also valid CSS3... @jcasimir unless you have serious objections, I think we should switch over.
JSAttend is renamed to EventManager, but I need to rename all the other ones.
The code in the third bullet under "Step 2: Requirements Always Change" reads
date = Date.strptime("11/12/08", "%m/%d/%Y")
I believe it should read
date=Date.striptime("11/28/08","%m/%d/%y")
Without the correct year, the day of the week will also not be correct.
Cheers
Open up a new file in your app/assets/stylesheets directory called styles.css.sass. Let’s write some!
"These changes will mean changing the same code in two places, and that a recipe for regression bugs."
Should read: "... and that's a recipe..."
"It breakdowns the time" -> "it breaks down the time"
I'm working on generalizing the curriculum for ongoing use. What are good candidates for removal?
Others...?
The awesome changes to 3.2.2 and the requirement of an attr_accessible necessitates revisions to all the Rails tutorials and sample code.
Notes from a user about JSBlogger:
Hi,
I'm working on the JsBlogger tutorial and I'm coming into a problem. I just finished the section on displaying tags but when I try to create a new article with new tags it says: "Can't mass-assign protected attributes: tag" and it says its the result of this code:
class Article < ActiveRecord::Base
attr_accessible :title, :body, :tag_list
has_many :comments
has_many :taggings
has_many :tags, :through => :taggings
def tag_list
return self.tags.join(", ")
end
def tag_list=(tags_string)
tag_names = tags_string.split(",").collect{|s| s.strip}
tag_names.each do |tag_name|
tag = Tag.find_or_create_by_name(tag_name)
self.taggings.build(:tag => tag)
end
end
end
I added the :tag_list to attr_accessible because it was saying it couldn't mass assign that as well. If you need any more information, let me know.
"We’ve come full circle: now it’s ignorant of the background work and caching going on behind the seens. "
Should be 'scenes'
Iteration 3: Outputting Cleaned Data, Step 1:
I'm really confused by the pseudocode in the comment:
def output_data
output = CSV.open("event_attendees_clean.csv", "w")
@file.each do |line|
# if this is the first line
# output the headers
output << line
end
end
I think it's not worth it checking in each iteration if that's the first line over and over again.
The easiest way to add the header is to configure that in the option hash:
@file = CSV.open(filename, {:headers => true, :return_headers => true, :header_converters => :symbol})
Should I rework that in form of a Pull Request?
Greetings!
Hello, I started working though the Blogger tutorial and have stumbled a bit in the Creating the Template portion of Iteration 0. Essentially, when I create index.html.erb
in app/views/articles
with the example code:
<h1>All Articles</h1>
<ul>
<% @articles.each do |article| %>
<li>
<%= article.title %>
</li>
<% end %>
</ul>
I get the following error in my browser:
ExecJS::RuntimeError in Articles#index
Showing C:/Users/General/My Documents/Code/blogger/app/views/layouts/application.html.erb where line #6 raised:
(in C:/Users/General/My Documents/Code/blogger/app/assets/javascripts/articles.js.coffee)
Extracted source (around line #6):
3: <head>
4: <title>Blogger</title>
5: <%= stylesheet_link_tag "application", :media => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
9: <body>
Rails.root: C:/Users/General/My Documents/Code/blogger
Application Trace | Framework Trace | Full Trace
app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__710993880_42455376'
Request
Parameters:
None
Show session dump
Show env dump
Response
Headers:
None
Everything has gone smoothly up until this point. Hopefully I'm not overlooking something?
Best,
Justin
times should be an html entity, it's showing up as x.
I'm unable to click links on this URL : http://tutorials.jumpstartlab.com/ on MacOS X Lion , Chrome 18 , Safari, Firefox 12
When disabling CSS all links work well.
Open up a new file in your app/assets/stylesheets directory called styles.css.sass. Let’s write some!
The code example, which we are instructed to paste into our existing code, uses a variable "number" which had not been initialized at that point in the tutorial.
On this page: http://tutorials.jumpstartlab.com/paths/ruby_one_day.html there are links to what looks like should be a Rails project called JSAttend. That project doesn't exist in the source.
Seeing as this is a Ruby in 100 minutes, wouldn't it be more appropriate not to do a Rails project and do a Ruby-only based project like EventManager instead? http://tutorials.jumpstartlab.com/projects/eventmanager.html
Write a short couple paragraphs about setting up JSBlogger
Proof it, try it, then replace all the tag markers in the source text with a link to the instructions.
Store the whole thing under /topics
I'd like to shrink the page to be less wide, more long, like http://jumpstartlab.com/resources/rails-jumpstart/jsblogger/
We should probably flip the code snippet styles to use dark-on-light for highest readability. That will need to be done for the print styles anyway, so they might as well be unified.
The jQuery tutorials just got dumped in the SOURCE directory in their original textile. They need markup revision to markdown and a ton of technical/English editing.
After Creation
I was unable to use the path given: redirect_to article_path(@comment.article).
Routing Error
No route matches {:action=>"show", :controller=>"articles"}
I was able to successfully complete this step using:
redirect_to articles_path(@comment.article) instead.
I believe the link to screen.css
at the end of Iteration 0 is broken?
There's no section about validations in the model, handling them in the controller, etc.
We should really just kill the RubyMine references, ST is basically better to introduce people to, and what we've been doing for a while.
When deploying, I get this:
DEPRECATION WARNING on line 107 of /tmp/build_st1qztm6vxt4/sass/base/_layout.scss:
Using @extend within directives (e.g. @media) is deprecated.
It will be an error in Sass 3.2.
This will only work once @extend is supported natively in the browser.
Also on lines
DEPRECATION WARNING on line 124 of /tmp/build_st1qztm6vxt4/sass/base/_layout.scss:
DEPRECATION WARNING on line 155 of /tmp/build_st1qztm6vxt4/sass/base/_layout.scss:
DEPRECATION WARNING on line 57 of /tmp/build_st1qztm6vxt4/sass/partials/_navigation.scss:
Fix link(s) in JSAttend to point to http://tutorials.jumpstartlab.com/assets/jsattend/event_attendees.csv
If you have a UL inside a UL, then the interior UL get's a large bottom margin. For example, search for "Do they map convenience" on: /routes/router.html
So I made it through the Event Manager tutorial. It was awesome. Thank you so much for sharing.
I only came across one other minor error: In Iteration 5, Step 1, there is some example code for using the gsub
method:
custom_letter = letter.gsub("#first_name","#{line[:first_name]}")
custom_letter = custom_letter.gsub("#last_name", "#{line[:first_name]}")
But I believe on the second line :first_name
should actually be :last_name
That's all I found! Thanks again!
~justin
We should add haml to the default generators so that later views are generated with haml and not erb.
It says, "Sorry, I cannot find /projects/jsblogger.html"
The feedback tab, while useful, distracts me from reading especially on my iPhone. It also blocks the words a little bit. Create an option to hide the feedback bar or move it to the bottom of the page.
In the tutorial there is a section creating a tag helper.
def tag_links(tags)
links = tags.collect{|tag| link_to tag.name, tag_path(tag)}
return links.join(", ")
end
Since I'm new I didn't understand why my html was being escaped in the view. I needed to use .html_safe. I'm not entirely sure why, but it seems to work. Maybe a note should be added about this?
def tag_links(tags)
links = tags.collect{|tag| link_to tag.name, tag_path(tag)}
return links.join(", ").html_safe
end
In the Tagging > An Interface for Tagging section the code for tag_list return object references instead of strings. When you edit an article it lists the object id's in the tags field.
def tag_list
return self.tags.join(", ")
end
This is probably not the best way to do this, but I ended up with:
def tag_list
#return self.tags.join(", ")
new_tags = []
self.tags.each do |tag|
new_tags << tag.name
end
return new_tags.join(", ")
end
Then, try calling inspect on the line object again:
def print_names
@file.each do |line|
puts inspect
#puts line[2] + " " + line[3]
end
end
Should the "puts inspect" be "puts line.inspect"?
add a note about finish returning to the caller frame
Currently the source text has .note and .opinion DIVs. The markdown engine is not processing the text inside the DIV, meaning it gets no P tags and no italics, PRE, etc.
the links to the css in jsblogger and jsmerchant are broken
On the SalesEngine page:
"As this project is very complex, consider the requirements fluid until 11:59PM, Monday, March 26th."
Is this project now considered specced out enough to remove this user note? If not, what's a reasonable date to replace it?
@whatever = nil
is actually a class instance variable, not an instance variable
It has to look good printing.
I was generally happy with the old tutorial styles: http://jumpstartlab.com/resources/rails-jumpstart/jsblogger/
The sections are short enough that they probably don't need page breaks, but the body text has to be plenty large for old people to read :)
The markdown engine should be configured to auto-link URLs
Like Graylog2 logging
initializer.
I don't remember what this means.
Throw down those good ideas you two rattled off. @steveklabnik @mattyoho
Adding a note or two about pry would be cool
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.