Javascript

#Leveraging Reflux (flux) with React like a pro
My latest project for a well known clothing retailer has involved writing a React based web app. It has a staggering amount of data that needs to update different parts of the app. To accomplish this, we are using React (of course) and Reflux.
So you’ve heard React is the new hotness that all the cool developers are adding to their resume.

A project I’m currently work on (for a very popular apparel company) is employing AngularJS for their site. I’ve created some directives to handle collecting addresses for billing and shipping. Reusable directives with their own isolate scope. To add more awesome to the mix, I’m using ngMessage to show various error messages with the form.
This all works great, but the problem was showing the error messages correctly when there are two forms on the page.

The conundrum is how do you deploy a web app to Heroku that needs to be compiled without including compiled files in your source?
Maybe you have some SASS that needs to be compiled into CSS. Maybe you want to minify your JavaScript, or cache bust with some appended hash tags. In any case you want to run some tasks on your code to produce your distribution or build.

Every project tends toward insanity, it’s your job to Keep it Sane, Stupid.
This is the first in a multipart series on Node.js concepts that I consider to be essential to writing sane web apps. You already know how to Node and now it’s time to get serious about building apps. The problem you’ll run into every growing project is complexity. These concepts will help you keep things sane.

Here I want to go through some casting tricks that can be used for better data manipulation.
Booleans Build in Boolean() The easiest way is to use the builtin Boolean() method.
Boolean('true'); // true Boolean(1); // true Boolean('false'); // true !!!!GOTCHA!!!!! Boolean(0); // false // Careful Boolean([]); // true Double Negative This will cast anything as either true or false, there are of course a few quirks that may not be obvious.

Most people who only know some jQuery and little JavaScript in the browser scratch their head and wonder how this lame language can be run on a server, or better yet, how most of your front end can be run on this messed up language.
JavaScript hits the nail on head Functions as first class citizens. So what does this mean? Functions can be embedded inside other functions
var outer = function embedded() { var inside = function() { var deep = 'variable inside a function, inside a function'; }; } Notice how outer has a function inside it called inside, and inside the inside function is a variable deep?

Appcelerator is a moving target, developed and changing pretty fast. The old way was using the **url: ** property of a window to open up a new screen with a javascript screen.
Old and Busted var window = Ti.UI.createWindow({ url: 'screen.js' }); Another Old Way Then came the Tweetanium structure, while a solid way to set up, it’s not the route Appcelerator is recommending anymore.
See my post for more information on the Tweetanium Setup