Skip to content

Commit 61d3aee

Browse files
committed
Merge pull request coffeescript-cookbook#111 from markmontymark/master
Aspell mods and a few grammar fixes
2 parents 2ce493f + 40d4dfd commit 61d3aee

19 files changed

+33
-33
lines changed

authors-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ If the answer to either question is no, you might have some code that is a "clev
163163

164164
## What If My Recipe is Inefficient/Too Big/Too Slow?
165165

166-
If it solves a problem to which the alternative is to _not_ solve the problem, share it. Let the reader decide if they want to use it. Sometimes we want tight efficient code, other times we want a robust featureset. If the code has abysmal performance characteristics, be sure to warn the reader in the Discussion.
166+
If it solves a problem to which the alternative is to _not_ solve the problem, share it. Let the reader decide if they want to use it. Sometimes we want tight efficient code, other times we want a robust feature set. If the code has abysmal performance characteristics, be sure to warn the reader in the Discussion.
167167

168168
## Can I Edit An Existing Recipe?
169169

chapters/ajax/ajax_request_without_jquery.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ loadDataFromServer = ->
4646
req = new XMLHttpRequest()
4747

4848
req.addEventListener 'readystatechange', ->
49-
if req.readyState is 4 # ReadyState Compelte
49+
if req.readyState is 4 # ReadyState Complete
5050
successResultCodes = [200, 304]
5151
if req.status in successResultCodes
5252
data = eval '(' + req.responseText + ')'
@@ -69,13 +69,13 @@ We define our loadDataFromServer callback beginning on line 2.
6969

7070
We create a XMLHttpRequest request object (line 3) and add a *readystatechange* event handler. This fires whenever the request's readyState changes.
7171

72-
In the event handler we check to see if the readyState = 4, indicating the request has completed. Then, we check the request status value. Both 200 or 304 represent a succsessful request. Anything else represents an error condition.
72+
In the event handler we check to see if the readyState = 4, indicating the request has completed. Then, we check the request status value. Both 200 or 304 represent a successful request. Anything else represents an error condition.
7373

7474
If the request was indeed successful, we eval the JSON returned from the server and assign it to a data variable. At this point, we can use the returned data in any way we need to.
7575

7676
The last thing we need to do is actually make our request.
7777

78-
Line 13 opens a 'GET' request to retreive the data.json file.
78+
Line 13 opens a 'GET' request to retrieve the data.json file.
7979

8080
Line 14 sends our request to the server.
8181

chapters/arrays/filtering-arrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ array.filter (x) -> x > 5
1818
# => [6,7,8,9,10]
1919
{% endhighlight %}
2020

21-
In pre-EC5 implementations, extend the Array prototype to add a filter function which will take a callback and perform a comprension over itself, collecting all elements for which the callback is true. Be sure to check if the function is already implemented before overwriting it:
21+
In pre-EC5 implementations, extend the Array prototype to add a filter function which will take a callback and perform a comprehension over itself, collecting all elements for which the callback is true. Be sure to check if the function is already implemented before overwriting it:
2222

2323
{% highlight coffeescript %}
2424
# Extending Array's prototype

chapters/arrays/reducing-arrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You have an array of objects and want to reduce them to a value, similar to Ruby
99

1010
## Solution
1111

12-
You can simply use Array's `reduce()` and `reduceRight()` methods along with an anonoymous function, keeping the code clean and readable. The reduction may be something simple such as using the `+` operator with numbers or strings.
12+
You can simply use Array's `reduce()` and `reduceRight()` methods along with an anonymous function, keeping the code clean and readable. The reduction may be something simple such as using the `+` operator with numbers or strings.
1313

1414
{% highlight coffeescript %}
1515
[1,2,3,4].reduce (x,y) -> x + y

chapters/arrays/testing-every-element.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ evens.every (x)-> x % 2 == 0
1818
# => true
1919
{% endhighlight %}
2020

21-
Array.every was addded to Mozilla's Javascript 1.6 and made standard with EcmaScript 5. If you to support browsers that do not implement EC5 then check out [`_.all` from underscore.js][underscore].
21+
Array.every was added to Mozilla's Javascript 1.6 and made standard with ECMAScript 5. If you to support browsers that do not implement EC5 then check out [`_.all` from underscore.js][underscore].
2222

2323
For a real world example, pretend you have a multiple select list that looks like:
2424

chapters/arrays/where-for-arrays-of-objects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ cats.where name:"bubbles", (a, b) -> "#{ a }".toLowerCase() is "#{ b }".toLowerC
7777
# now it's case insensitive
7878
{% endhighlight %}
7979

80-
it's more a method to deal with collection and it could be rename as "find" but popular libraires like underscore or lodash name it "where".
80+
it's more a method to deal with collection and it could be rename as "find" but popular libraries like underscore or lodash name it "where".

chapters/dates_and_times/date-of-thanksgiving.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ chapter: Dates and Times
55
---
66
## Problem
77

8-
You need to calculate when is Thanksgivinig in given year.
8+
You need to calculate when Thanksgiving is in a given year.
99

1010
## Solution
1111

chapters/dates_and_times/days-between-two-dates.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You need to find how much seconds minutes, hours, days, months or years has pass
99

1010
## Solution
1111

12-
Use JavaScript's Date function getTime(). Which provides how much time in miliseconds has passed since 01/01/1970:
12+
Use JavaScript's Date function getTime(). Which provides how much time in milliseconds has passed since 01/01/1970:
1313

1414
{% highlight coffeescript %}
1515
DAY = 1000 * 60 * 60 * 24
@@ -22,12 +22,12 @@ days_passed = Math.round((d2.getTime() - d1.getTime()) / DAY)
2222

2323
## Discussion
2424

25-
Using miliseconds makes the life easier to avoid overflow mistakes with Dates. So we first calculate how much miliseconds has a day.
26-
Then, given two distincit dates, just get the diference in miliseconds betwen two dates and then divide by how much miliseconds has a
25+
Using milliseconds makes the life easier to avoid overflow mistakes with Dates. So we first calculate how much milliseconds has a day.
26+
Then, given two distinct dates, just get the difference in milliseconds between two dates and then divide by how much milliseconds has a
2727
day. It will get you the days between two distinct dates.
2828

29-
If you'd like to calculate the hours between two dates objects you can do that just by dividing the diference in miliseconds by the
30-
convertion of miliseconds to hours. The same goes to minutes and seconds.
29+
If you'd like to calculate the hours between two date objects, you can do that just by dividing the difference in milliseconds by the
30+
conversion of milliseconds to hours. The same goes for minutes and seconds.
3131

3232
{% highlight coffeescript %}
3333
HOUR = 1000 * 60 * 60

chapters/dates_and_times/moon-phase-for-date.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You want to find the current phase of the moon.
99

1010
## Solution
1111

12-
The following code provides a method to calcualate the phase of the moon for a given date.
12+
The following code provides a method to calculate the phase of the moon for a given date.
1313

1414
{% highlight coffeescript %}
1515
# moonPhase.coffee

chapters/design_patterns/adapter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In such a situation, the [Adapter Pattern](//en.wikipedia.org/wiki/Adapter_patte
1919
class AwesomeGrid
2020
constructor: (@datasource)->
2121
@sort_order = 'ASC'
22-
@sorter = new NullSorter # in this place we use NullObject pattern (another usefull pattern)
22+
@sorter = new NullSorter # in this place we use NullObject pattern (another useful pattern)
2323
setCustomSorter: (@customSorter) ->
2424
@sorter = customSorter
2525
sort: () ->

0 commit comments

Comments
 (0)