Wednesday, February 1, 2012

Massive Bang.js updates

Hello internet.

I have been spending quite a bit of time refactoring the server side code for bang.js lately.  I started a total conversion of it to coffeescript.  Its quite amazing how easy it is to translate into coffeescript which natively supports classical inheritance.

bang.coffee is our main file, which is executed by the iced coffee-script compiler

abstractServer.coffee and server.coffee contain the coffee ingredients to boot up the server.

You'll also notice I've made significant improvements on the layout of the project.  Now there are two main folders:  client and server.

Tuesday, January 17, 2012

Books I am reading

Hello!

First, I'll recommend Javascript: The good parts.

Currently, I am reading the following:

Javascript Web Applications by Alex MacCaw
Javascript Patterns by Stoyan Stefanov

The javascript patterns book is exceptional for getting an idea of the power and customization javascript offers.

Wednesday, January 4, 2012

ExtJS 4.0 MVC dynamic controllers

ExtJS4 has been designed with an inheritance class based MVC core framework along with its rich set of UI controls.  The current ExtJS 4.0.7 framework supports a concept of an Application.  This application class, from my experience, works well if there is just one defined and initialized.

An application can have many controllers, however.  Each controller can take models, stores, and views.  The controller is the meat of an application and controls the logic for the views.  It is the controller we want to dynamically add at run time.

Lets setup our ajax getJS loader. Then lets get the interface, which will contain the application definition.



The long and short of it, you need to keep a reference of the application itself.  In my case:  Ext.bang.util.app is where I'm storing it.




Now, when I want to add another "sub" application (in this case, a login window), we use the application reference to getController('login'), and then init() it to run its init method.
remotejs.getJS({ js: 'login.js', app: 'bang'}, Ext.bang.util.run);




The controller does the rest. Take a look at the bang client code to see how it all fits together.

Bang.js

Hello.  Its been a while.  I took a break from coding up until around December, and since then I've been working on a new framework called bang.js.

I will take in many concepts from portalstack for security and ui.  Take a look at my github page:

https://github.com/mikekunze/bang.js

Monday, September 12, 2011

Parsing multiple files - async style

One project I worked on recently involved reading in multiple Metrics logs for the Illumina iScan.  Basically, a file represented an entire scan session, where a scan consisted of a bunch of sections.  These sections included a bunch of metrics that needed to be run against a pass/fail algorithm.

Therefore, each section is graded with a pass /fail.  All of this information is organized into a hierarchical structure of many beadChips with many Sections with many section values.

Using the whole async approach, I am able to load and process approx 54 files over smbfs in seconds and then run queries against it using a web front end.

Here is the gist for populating the available metric file array.




Once we have the list of metrics files, we create beadChip objects:

for each metrics file
    new beadchip(file);

The object automatically calls its init script, which uses async to build the object's information from the log file.




Finally, here is the forEach async function used in building the beadChip:

Friday, September 2, 2011

Adding Twitter, GitHub, and LinkedIn authentication

Before I jump to the meat, we need to discuss a bit what is required for 3rd party authentication to twitter, github, and linkedin.  These social based sites all have developer APIs, which I think is an awesome open idea.  For the most part, I will be using their API for OAuth authentication, eliminating the need for me to focus on user registration.

Github's interface for creating apps was a bit hard to find, look at their documents or search google for github api.

Linkedin has a developer network and so does twitter.  Both are easy to use.

For each API, I had to create an "application" on their platform.  I receive a consumer ID and secret key.  These are used to tell them who I am when requesting a bridge for authentication.


gists to come

ExtStack on GitHub

A few nights ago, I started up a new project called extstack.  Instead of designing a registration and authentication system, I will rely on the nodejs module, everyauth.  Everyauth authenticates with many different popular social sites:  twitter, facebook, github, etc.

This new project will have exactly the same requirements and goals as portalstack, but with a more useful name and a little more care in the architectural design of the stack.

I investigated Express and its template abilities, such as jade.  I have since learned jade works well with everyauth, eliminating redundant lines of code and simplifying the HTML UI aspect of the stack.


Check it out:  https://github.com/mikekunze/extstack
Everyauth: https://github.com/bnoguchi/everyauth