Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View justinbmeyer's full-sized avatar

Justin Meyer justinbmeyer

View GitHub Profile

Problems with the AMD:

Types require plugins

require(['css!style.css','ejs!template.ejs'], function(){})

I probably don't have to say anymore about this.

Doesn't work well with foder-based organization

@justinbmeyer
justinbmeyer / fastworkerswithstrings.md
Created June 12, 2012 01:15
Fast Workers with strings

I should be able to send the same message to many workers with the same message with no incurred copying cost. This is because there is no way to modify a string in JavaScript, only create new strings. So, I should be able to call:

javascript var bigString = " .... "; worker1.postMessage(bigString); worker2.postMessage(bigString); ...


And it should be smart enough to pass the reference around and not copy anything.  The only copying would be done later if I read or created substr's of bigString.
@justinbmeyer
justinbmeyer / prometheus.md
Created June 12, 2012 02:41
Ten problems with Prometheus

1. The first scene

The alien, presumably killing supposedly started life on Earth. Exactly how does adding your DNA eventually evolve right back to match humans? There are some other theories that might make more sense scientifically. But why leave it so unclear?

If it is not Earth, how can the engineer breath? They were terraforming the planet for a reason I suspect. Which brings me to a minor point ...

2. How did the Engineer breath?

How did he go from his crashed ship to the escape pod.

@justinbmeyer
justinbmeyer / handlebars.md
Created June 14, 2012 06:35
Why do you like Handlebars (and concerns about live-binding)

I'm considering adding an alternative to CanJS's EJS live-binding system. I really like EJS, it's extremely powerful, but ugly to look at. So, I'm trying to create a better mouse-trap.

Currently, the most popular mouse-trap seems to be Handlebars. What do you like about it?

  • Syntax, or
  • Prepared data

Syntax

Handlebars uses {{}} for insertion and {{#}} and {{/}} for widgets and control structures.

@justinbmeyer
justinbmeyer / large.md
Created June 16, 2012 21:29
On Large JS Apps

A few points:

The article really only talks about static vs dynamic languages:

Not everybody is as smart as Gilad Bracha or John Resig and those that aren’t – like this author – are probably better off with writing their code in a statically typed language.

There's no other reason than this on why JS isn't suitable for large web apps.

His article seems to imply that all dynamic languages are not suitable for large apps of any kind (he only talks web apps, but a safe assumption). There are many examples of large apps written in a variety of languages (take anything written in php or ruby).

@justinbmeyer
justinbmeyer / bbuicanjs.md
Created June 22, 2012 16:47
BackboneUI done with CanJS

Button

<button><%= coffee.attr('roaster') %></button>

Checkbox

<input type='checkbox'

If the users's time was 1970-01-01 and they were shown a page titled "tomorrows reservations", it would show no reservations.

However, this would be correct from the user's computer's perspective, just not from reality (unless maybe they are traveling at light speed).

In my opinion, despite the advantage of always showing reality, no matter what time the user has, it's better to use the client's local time for the following reasons:

  • expectations
  • accuracy
@justinbmeyer
justinbmeyer / observeOverPub-Sub.md
Created August 17, 2012 15:49
Observes over Pub-Sub

Here's how to build an app with something like CanJS and AMD-like modules (using steal). For this example app, consider a tree-like nested grid where you can select locations and get more information. The app might look something like:

IL
Chicago
@justinbmeyer
justinbmeyer / REST relational algebra.md
Created September 20, 2012 02:07
A prescription for a rest endpoint.

Purpose

Client-side models are becoming more common. Most work with JSON-REST interfaces by default. However, there is no standards around manipulating the set of data returned by a rest service. This attempts to come to some standard.

Goal

  • Make it easy to understand and have close parallels with common SQL paradigms and relational algebra.
  • Make work with standard server-side Query string libraries.

Existing Problems

@justinbmeyer
justinbmeyer / javascript.md
Created November 27, 2012 16:58
What you must know about JavaScript

Before learning JavaScript, it's important to learn how it fits into the larger picture of the Browser and DOM (and your webapp).

To start, lets walk through a very basic "Hello World" webpage. Assume that the server at helloworld.com has this HTML file. What happens immediately after a user enters the URL for helloworld.com and presses enter?

  1. First, the browser creates a HTTP request for index.html. The server returns the HTML as part of the HTTP response.

  2. The browser feeds the HTML to it's DOM engine which begins processing the HTML and building a HTML document and it's HTML elements. For example it will create a DocumentElement when it sees an html element, and add a child head element when it sees that. When a script tag is encountered, the browser passes the contents of that script tag to it's JavaScript engine to be evaluated.