Giter Site home page Giter Site logo

library's Introduction

Our eBook library.  More coming soon...

library's People

Contributors

adrianholovaty avatar andrewpthorp avatar corydeppen avatar crdx avatar crossblaim avatar djebbz avatar erebor avatar evmcl avatar faisal avatar jm avatar jroes avatar justinko avatar locks avatar lorensr avatar maccman avatar michaelblume avatar michaelficarra avatar misfo avatar satyr avatar steveklabnik avatar stevenhaddox avatar t2 avatar timfletcher avatar zehzinho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

library's Issues

Coffeescript Chapter 2 Syntax

  trigger = (events...) ->
  events.splice(1, 0, this)
  this.constructor.trigger.apply(events)

when I invoke trigger(1, 2, 3)

it will raise exception:
TypeError: Cannot call method 'apply' of undefined

Typo in Coffeescript Bad Parts

In last paragraph of Strict Mode Usage:

"Whilst I recommend enabling strict mode, but it's worth noting that script mode doesn't enable..."

Should say "strict mode doesn't"

options argument missing in cake discussion

In the part of the chapter that says

task 'build', 'Build lib/ from src/', ->
  # Now we have access to a `options` object

we need an options argument:

task 'build', 'Build lib/ from src/', (options) ->

[Not exactly an issue] Japanese Translation

I translated the coffeescript book into Japanese, but I don't know how you handle translation.
Do you have any strategy on that? or can I just maintain it on my repo?
As it's my first translation on github, I don't even know how to contact the author for this kind of matter, sorry for posting on "Issue" :[

minor revision

In the last sentence of the introduction:

"Now is definitely the time to jump on the CoffeeScript train, and you'll thank yourself for the time invested in learning about the language now, in lieu of the major time savings you'll make later."

"in lieu of" is not correct here, as it suggests the up-front investment is replacing later time savings.

"Now is definitely the time to jump on the CoffeeScript train. The time you invest in learning about the language now will be repaid by major time savings later."

Instance properties

According to the book (https://arcturo.github.io/library/coffeescript/03_classes.html) instance properties can be created in the following way:

class Animal
  price: 5 # instance property according to the book
  sell: (customer) ->

animal = new Animal
animal.sell(new Customer)

But when I checked generated JavaScript code it looks like price property was added to the prototype ๐Ÿ˜•...

Well, if you try to use it I guess in that case it will magically work because the number type in JavaScript is immutable, but let me just show you an example with mutable field:

class Store
 products: [] # instance property?

 addProduct: (name) ->
  @products.push(name)

foodStore = new Store
foodStore.addProduct 'milk'

motoStore = new Store
motoStore.addProduct 'tyre'

console.log motoStore.products # ['milk', 'tyre'], boom

So obviously products property was added to the prototype and it's shared by both instances.

Could you include source code for Chapt 6 of CoffeeScript book?

This book is amazingly instructive, and by far the best primer to CS that I have found. But in Chapter 6 I find that you move too qucikly, and it's not clear to me how things are working together or where files are being placed. For example, having the index.html refer to application.js which is not created is confusing to me. But this would be cleared up just by having a directory with all of that source code in place.

Thanks!

Error in chapter 7 (The Bad Parts): `type(aVar?)` doesn't work as described

Chapter 7 says:
"
If you're checking to see if an variable has been defined, you'll still need to use typeof otherwise you'll get a ReferenceError.

if typeof aVar isnt "undefined"
    objectType = type(aVar)

Or more succinctly with the existential operator:

objectType = type(aVar?)

"

However, the two statements are NOT equivalent, because type(aVar?) will unconditionally return "boolean", because applying the existential operator to a variable always returns a Boolean.

Typo

In coffeescript\02_syntax.html (264):

  • There's a longer discussing on this topic in chapter 7.
    +There's a longer discussion on this topic in chapter 7.

Coffee Script Book: Confusion in Chapter 2 (Syntax)

In the 2nd last para:

If you're using a null check before accessing a property, you can skip that by placing the existential operator right before the >opening parens. This is similar to Ruby's try method.

blackKnight.getLegs()?.kick()

I think that the text and code sample are conflicting. The text says:

placing the existential operator right before the opening parens

Whereas the code shows the existential operator after the parens

Can't run coffee index.coffee in ch6

Hello, i encounter a problem in ch6, and the error info is below:
progress is not defined.
After i delete the progress relative code, it works...

Type in 6th opening paragraph

Hi there!
Thanks for writing such a neat book!

In the sixth paragraph of "What is CoffeeScript?" is the sentence:

you'll get syntax errors if you compile JavaScript as-is

Which I believe should say "CoffeScript" instead:

you'll get syntax errors if you compile CoffeeScript as-is

Typo in coffeescript Classes chapter

In
"alert("This parrot is no more") if parrot.rip()"
rip isn't a function, so parentheses should be removed:
"alert("This parrot is no more") if parrot.rip"

Navigation

It would be nice to include a link to the next page, at the bottom of each page. Or reuse the main-navigation.
It's kinda weird one has to go BACK to the main nav in order to CONTINUE.
Thank you!

Chapter 2: Syntax

names = sam: seaborn, donna: moss
alert("#{first} #{last}") for first, last of names

seaborn and moss need to be in quotes.

Mixins example can yield to object collision

The objects need to be cloned before being added in order to prevent different classes extending the same mixin from referencing the same properties.

The example needs to be amended as such :

clone = (obj) ->
  if not obj? or typeof obj isnt 'object'
    return obj

  newInstance = new obj.constructor()

  for key of obj
    newInstance[key] = clone obj[key]

  return newInstance

moduleKeywords = ['extended', 'included']

class Module

    @extend: (obj) ->
        for key, value of obj when key not in moduleKeywords
            @[key] = clone value

        obj.extended?.apply(@)
        this

    @include: (obj) ->
        for key, value of obj when key not in moduleKeywords
            @::[key] = clone value

        obj.included?.apply(@)
        this

"Instance properties" are not actually in the instance

In chapter 3 you are introducing instance properties. The syntax you are using is, in my opinion, not generating a instance property. The value is saved in the prototype of the class and not in this. Additionally, if you initialize with an object the object will be shared between all instances and changes on it will apply to all instances.

I would recommend initializing an instance property in the constructor.

Please fix this as you are having a high google rank on a search for 'coffeescript property'.

mixin description error

I think this is an error in the description of a mixin.

imaget

I think mixins are easy in coffeescipt?

Chapter 7 typo

In the function definition section of chapter 7:

"The is because of function scope." should be "This is because of function scope."

Wrong URI for the browser-based CoffeeScript compiler

In chapter 1, it says:

In fact, you can use the browser-based CoffeeScript compiler yourself, by including this script in a
page, marking up any CoffeeScript script tags with the correct type.

But both the link in that paragraph (http://jashkenas.github.io/coffee-script/extras/coffee-script.js) and the one used in the script below don't exist. I used https://raw.githubusercontent.com/jashkenas/coffeescript/master/extras/coffee-script.js and that worked, but probably there is a better option.

Thanks for the book.

coffeescript/ch6 : "package" is a reserved keyword.

There's a minor typo in the Applications chapter of The Little Book on Coffeescript. In the part where we boot stitch up, a variable in the code is named package which seems to be a reserved keyword.

CoffeeScript version 1.3.3 throws up an error on the lines of:

SyntaxError: In repl, reserved word "package" on line 6

Here's the code in question:

package = stitch.createPackage(
  # Specify the paths you want Stitch to automatically bundle up
  paths: [ __dirname + "/app" ]

  # Specify your base libraries
  dependencies: [
    # __dirname + '/lib/jquery.js'
  ]
)

P.s. Hats off for the great work! :)

Coffeescript Chapter 6

I'm new to all this so maybe it's something I did wrong. But I had to add two more lines to package.json so that heroku would run the app successfully.

"underscore": "~1.3.1",
"async": "~0.1.15",

Critical typo in javascript code (chapter #2)

In the "Aliases & the Existential Operator" section there are two javascript code snippets:

if (typeof brian !== "undefined" && brian !== null) {
  praise;
}

and

var velocity;
velocity = typeof southern !== "undefined" && southern !== null ? southern : 40;

I think that "&&" operator is wrong, and there should be "||" instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.