Skip to content

Instantly share code, notes, and snippets.

Justin Meyer justinbmeyer

Block or report user

Report or block justinbmeyer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View my
<html>
<head>
</head>
<body>
<ul>
<li><a href='#lobsterroll'>Lobster Roll</a></li>
<li><a href='#cookies'>Cookies</a></li>
<li><a href='#crab'>Crab</a></li>
</ul>
<div id='lobsterroll'>
@justinbmeyer
justinbmeyer / thingsaboutjmvc.md
Created Oct 3, 2011
Things you might not know about JavaScriptMVC
View thingsaboutjmvc.md
  1. You can use every part on its own via the download builder.

  2. It's core MVC components are only 7k minified and gzipped.

  3. You can make changes and just refresh your browser. But for production, you can build all your files into a single script.

  4. FuncUnit can simulate complex user actions and run your tests in Selenium or PhantomJS.

  5. It's MIT licensed, 3 years old and maintained by Jupiter Consulting and several contributors.

View deferreds.md

3.1 Backlog - Deferreds

jQuery 1.6 brought Deferred support. They are a great feature that promise to make a lot of asynchronous functionality easier to write and manage. But, many people struggle with uses other than 'waiting for a bunch of Ajax requests to complete'. For 3.1, we identified an extremely common, but annoying, practice that becomes a one-liner with deferreds: loading data and a template and rendering the result into an element.

View JavaScriptMVC_3-2.md

Features

steal

Most of the work for the new release has been around a new version of steal. We've re-worked steal from the ground up to:

  • Simplify the API
  • Make loading faster, but still work with any script.
  • Enable 'on-demand' loading
View closureaccess.md

Background

Controller is really an event manager, it lets you listen to objects and when destroyed, automatically unbinds all event handlers.

It lets you listen to events on objects in the window like:

  Foo.Bar = new SomethingThatMakesEvents();

  $.Controller('FooListener',{
View TemplatedEventBinding.md

3.2's $.Controller - Templated Event Binding Goodness

JavaScriptMVC 3.2 brings a lot of great features and enhancements. So many features that changes to $.Controller didn't make the cut for our upcoming 3.2 article. This article reviews 3.2's $.Controller and talks about templated event binding (something we neglected to write up for 3.1).

Bind and Memory Leaks

Neglecting to unbind event handlers is the easiest way to create memory leaks. This is extremely common in an MVC architecture as you constantly listen for model changes:

Task.bind('created', function(ev, newTask){
  // add task to list
View TemplatedEventBinding.md

3.2's $.Controller - Templated Event Binding Goodness

JavaScriptMVC 3.2 brings a lot of great features and enhancements. So many features that changes to $.Controller didn't make the cut for our upcoming 3.2 article. This article reviews 3.2's $.Controller and talks about templated event binding (something we neglected to write up for 3.1).

Bind and Memory Leaks

Neglecting to unbind event handlers is the easiest way to create memory leaks. This is extremely common in an MVC architecture as you constantly listen for model changes:

Task.bind('created', function(ev, newTask){
  // add task to list
@justinbmeyer
justinbmeyer / 3.x.md
Created Oct 18, 2011
JavaScriptMVC 3.X Video
View 3.x.md

Outline

  • highlight download builder
  • create an indexable app
    • use coffee, less?
    • testing
    • routing
View comparison.md

For DocumentJS, I'm trying to quickly get line numbers from a file given a character position. For a given source, my character position would always increase. So I wanted to call it like:

var getLine = lineNumber("BIG SOURCE\n...");

getLine(54)   //->2
getLine(3453) //->55

I created 2 different ways of doing it.

@justinbmeyer
justinbmeyer / JS100.md
Created Nov 19, 2011
What you must know about JavaScript
View JS100.md

Dynamic Scripting

Code in languages like Java or C is compiled to byte or machine code. When your app runs, it's taking instructions from code and operating on data.

Dynamic Languages, like JavaScript are rather different. Instead of a strong separation between code and data, your application is built one statement at a time. You are effectively programming your program.

For example, what happens when a script tag like <script type='text/javascript' src='myapp.js'></script> loads the following code?

var JS = {};
You can’t perform that action at this time.