I was talking to my coworker, Todd Anderson, today about running build systems in Sublime Text 2. It’s a great editor, very powerful and configurable. But somewhat of a lack of documentation on all those features. One problem we both had was setting up multiple build systems on a project, say one for running unit tests, one for running JSLint, one for deployment, etc. You can specify build systems right in a project file as per this reference: https://www.sublimetext.com/docs/2/projects.html. For a drop dead simple example, you could have one that launches your index.html file in chrome, and another that launches your unit tests in tests.html. This would look something like this:
Read more...Generally I like to use my blog for dispensing knowledge, advice, opinions, thoughts, musings, and of course, FACTS. But occasionally I get stuck on a point and all my research leads me to a dead end, and I’ll write a post that asks for help. I figure the answers just might help someone else down the line anyway, so it’s not purely selfish.
OK, so I’ve learned to stop worrying and love JavaScript. HTML I can tolerate. But CSS is gonna kick my ass.
Read more...FACT: After my post of a few days ago, I’m going to try to avoid beginning blog posts with the word “FACT”. I think labeling something as an ALL-CAPS FACT is just taunting someone to come along and dispute whatever you say. But anyway, I’ve already done it again.
OK, in the aforementioned post, I said that there were other, possibly … “better” ways of reusing code in JavaScript than by emulating classes. Take that “better” with a grain of salt. There are other ways, and some consider them better.
Read more...As interesting as this problem was to solve, it seems I could have solved it easier by grabbing the latest version of underscore, which does indeed define _ on global even when loaded via Require.js. Anyway, I learned a lot in the process!
I’ve been enjoying working with Backbone.js in the past month or two, and now I’m getting into Require.js to better organize my projects. I ran into a killer problem that I know others have encountered, as there are plenty of fixes and workarounds for it around the web. But I’ll add mine to the mix, as I think it’s pretty simple and elegant, if I do say so myself.
Read more...Facts.
Fact: JavaScript is an object oriented language.
Fact: JavaScript does not have classes.
Fact: JavaScript is dynamic and expressive enough to create structures that emulate classes.
Beyond those three facts, everything else here will be theory or opinion.
Expansion of facts:
JavaScript is an object oriented language but it does not have classes. Some people see these two statements as conflicting, but object oriented does not necessarily equal classes. Classes are only one paradigm used in object oriented systems, one of the more common ones, yes, but not the only one. Object oriented merely means that you have objects which contain both data and behavior – or properties and methods if you like.
Read more...I’m very happy to announce the release of this book, and need to say a few things about it.
First, this is a direct JavaScript port of my previous books, Foundation ActionScript Animation: Making Things Move!, and Foundation ActionScript 3.0 Animation: Making Things Move!. Chapter by chapter, they cover the same material, but teach you how to do the same things in JavaScript, mostly with canvas.
Read more...I end this year feeling more excited about technology and programming than I have in several years. That’s really good because for most of last year and into the middle of this year I was going through a bit of a geek crisis. Nothing really seemed to excite me as a programmer. I ended the year doing Windows Phone 7 development, which is a great development platform, but unfortunately almost nobody has the devices. I was tired of iPhone development and nothing in Flash was exciting me.
Here’s kind of how my year went:
Read more...In case you didn’t get to see my Making Tools presentation this year (or if you tried to see it at RIA Unleashed and suffered through my technical difficulties), you can now see it on line:
https://techchannel.att.com/play-video.cfm/2011/12/1/Conference-TV-Flash-and-the-City-Making-Tools
You can hear the guy who corrected me by pointing out that apparently crows use tools to make tools at 4:00. 🙂
Read more...File this under “really writing this for myself so I can refer back to it later.”
[php lang=“JavaScript”]window.onload = function() {
var foo,
offsetX,
offsetY;
// so it exists
foo = document.createElement(“div”);
document.body.appendChild(foo);
// so we can see it:
foo.style.width = “100px”;
foo.style.height = “100px”;
foo.style.backgroundColor = “blue”;
// so we can move it where we want:
foo.style.position = “absolute”;
// so it looks like something we should click on
foo.style.cursor = “pointer”;
I got my Kindle Fire last night and wanted to post some initial impressions of the device.
First of all, I love it. Great form factor, feels very solidly built, great display, does all that I need it to do. I could not put it down for more than 2 seconds last night. Take that as a 95% awesome. The rest of the stuff I say here will be in that 5% maybe not so awesome category, so read it with that in mind.
Read more...