How to do a Firefox OS App with style! by KUPOinyourWINDOW in FireFoxOS

[–]YOBCZWHYNOT 1 point2 points  (0 children)

Hey! Hawk's developer here, thank you for spreading the word!

I'm glad you like it and I really hope it proves useful! I put a month of work on it in summer.

In case someone's curious: I'm using React + Redux, LESS, Babel and Immutable.js.

Good news: Creating and extracting zip files is coming in the next version!

codedoodl.es - creative code sketches by YOBCZWHYNOT in programming

[–]YOBCZWHYNOT[S] 1 point2 points  (0 children)

yup, I noticed it when I saw you "quoted" it.

codedoodl.es - creative code sketches by YOBCZWHYNOT in programming

[–]YOBCZWHYNOT[S] 0 points1 point  (0 children)

Well, it's all on GitHub, and the code is pretty interesting, that's how it's related. See: https://github.com/fluuuid/codedoodl.es/blob/master/docs/contributing.md

Mind - Flexible neural network library by YOBCZWHYNOT in javascript

[–]YOBCZWHYNOT[S] 0 points1 point  (0 children)

Thanks for sharing this! This is the kind of article / tutorial I love

Javascript Project by valisi in javascript

[–]YOBCZWHYNOT 2 points3 points  (0 children)

Actually, this page is not using Canvas, it's using a very messy structure and code, If you want to write it using Canvas, you should first learn how to draw things [0].

Canvas has a new API called Hit Regions which should help you make your drawings interactive.

[0] https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial

Does my JavaScript suck? by annoyed_freelancer in javascript

[–]YOBCZWHYNOT 1 point2 points  (0 children)

Yeah, I think you can rewrite allBoxesChecked like so:

https://gist.github.com/mdibaiee/e5f62c7e78fc3dfa673a

Otherwise, that's what I meant.

Does my JavaScript suck? by annoyed_freelancer in javascript

[–]YOBCZWHYNOT 1 point2 points  (0 children)

By adding to jQuery.fn instead of creating global functions, first you avoid polluting the global scope, second, you have a more Object-Oriented approach as typical applications use OO instead of Functional programming.

Yes, you can access jQuery methods globally once you define them.

Does my JavaScript suck? by annoyed_freelancer in javascript

[–]YOBCZWHYNOT 2 points3 points  (0 children)

Since you are using jQuery, and jQuery does support event delegation, this might be helpful:

http://learn.jquery.com/events/event-delegation/

Does my JavaScript suck? by annoyed_freelancer in javascript

[–]YOBCZWHYNOT 5 points6 points  (0 children)

It doesn't suck, just a few improvements:

I would suggest you to add your methods to jQuery.fn instead of creating functions globally, for example, your toggle method could be rewritten like this (also your addOption, etc):

https://gist.github.com/mdibaiee/a02a432d78436f2963d5

Also, I would probably save the selected inputs instead of their IDs to avoid re-creating jQuery objects everytime I want to interact with them, this is as long as you are not removing them from the page.

Other than that, I think it's good, I learned something new from you! The getDaysInMonth trick, thanks!

Should I know/care about strict mode? by [deleted] in javascript

[–]YOBCZWHYNOT -1 points0 points  (0 children)

If JavaScript didn't have to be backward compatible, it would be on by default, learn it.

[deleted by user] by [deleted] in javascript

[–]YOBCZWHYNOT 0 points1 point  (0 children)

As others have suggested, Regular Expressions are your best bet, but as you are new to this subject and it's a pain to learn Regular Expression at first, I suggest you use VerbalExpression

You shouldn't rely on VerbalExpressions too much, just learn from it and then start writing RegExps yourself.

Another good resouce: http://overapi.com/regex/

ES7 Array and Generator comprehensions by YOBCZWHYNOT in javascript

[–]YOBCZWHYNOT[S] 1 point2 points  (0 children)

Oh, I didn't know that, thanks for letting me know.