max-mapper / browserify-website

the code that runs http://browserify.org
http://browserify.org
1 stars 0 forks source link

Awesome Minimal Viable Snippet #4

Open eugeneware opened 10 years ago

eugeneware commented 10 years ago

Some snippet that gets people "OMG! I can that? That was easy!"

Like the node.js http server example, but for browserify.

max-mapper commented 10 years ago

this one is pretty cool, but maybe not exactly what we are looking for http://requirebin.com/?gist=6264704

eugeneware commented 10 years ago

I think also having an inline (embedded jsfiddle type thing), might be cool.

In terms of snippets, definitely visualization type stuff would be cool. Maybe we could use @anvaka's visualization stuff if that's really modular.

Or the game engine stuff that's been built to be modular, can't remember the name of the libraries.

eugeneware commented 10 years ago

Or some d3 stuff, or some two-way databinding... or even some level.js stuff. Like full-text indexing or some stuff in the browser. Or... all of the above... Have a carousel of different snipets.

anvaka commented 10 years ago

Seven lines grid graph:

var graph = require('ngraph.generators').grid(10, 10);
var svg = require('ngraph.vivasvg')(graph);
svg.nodeTemplate(["<text y='-5'>{{id}}</text>", 
                  "<circle r='5' fill='#00BFFF'></circle>"].join('\n'));
svg.linkTemplate("<arrow stroke='#D3D3D3' from='{{pos.from}}' to='{{pos.to}}' offset='8'></arrow>'");
svg.run();

http://requirebin.com/?gist=9555719

anvaka commented 10 years ago

Confetti http://requirebin.com/?gist=9555946 :)

eugeneware commented 10 years ago

That's crazy @anvaka . Thanks mate!

eugeneware commented 10 years ago

Also, that modular game stuff - I think I found it: https://github.com/hughsk/game-modules/wiki/Modules

But I thought there was a website for it.

eugeneware commented 10 years ago

That game page is: http://crtrdg.com/

max-mapper commented 10 years ago

WIP page with a few demos is up at http://maxogden.github.io/browserify-website/demos.html

anvaka commented 10 years ago

@maxogden something is broken - there is a js error on the page right now

var headFile = files['page-head.html']
// Uncaught TypeError: Cannot read property 'page-head.html' of undefined 
max-mapper commented 10 years ago

@anvaka what browser are you using? does it happen if you view the /embed urls individually? I am not seeing that error

anvaka commented 10 years ago

@maxogden it's OSX Chrome. Ah, I see what's going on. Gist returns this error:

"API rate limit exceeded for XX.XX.XX.XX. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)"
max-mapper commented 10 years ago

@anvaka gotcha, I see that intermittently + have a fix in the works

anvaka commented 10 years ago

One more example: easy to do quick micro benchmarking tests with @jdalton 's benchmark module.

E.g. what is faster: iterate over keys of object without prototype or with prototype?

Apparently on object without prototype, if I made this test correctly :)

http://requirebin.com/?gist=9561845