NotesThis is an article on the module pattern for Javascript, and some of its neat properties. I’ve been using it recently for projects like Wax and mmg, and think it’s a neat way to structure code and avoid some of the less likable parts of the language.FeedUnfurl
NotesDisclaimer: I am not a unix god, and pretty much hacked this together to get working (and it does for me), so a more concise method might appear, so I you do find one let me know, also if you break your PI it is not my fault =] .Unfurl
Notes You are looking at a javascript version of the MESS emulator, a program that emulates hundreds of machine types and will, eventually, be capable of running most known computer software programs. What you see here (and if you don't see anything, we apologize) is a Colecovision emulator running the homebrew Colecovision cartridge "Cosmo Fighter 2", in demo mode. Unfurl
NotesFor an upcoming canvas project I want to give the users the ability to upload the content of the canvas to an image sharing service. When looking for a suitable API I came across imgur.com the registration was trivial, and they support CORS and base64/dataurl uploads, perfect!FeedUnfurl
NotesIf you do a view-source you find no other script in use, yet it displays in the page. What is this sourcery*? Simple, and it was Mathias Bynens who got me onto it: just display script elements as block and add some generated content to show the “Source” text:FeedUnfurl
NotesI think it is a sign that as developers we are either terribly bored or we are out of ideas when we start to go down to bickering about violating accepted ways of development. We should concentrate on building amazing tools and experiences for users out there rather than smugly trying to undo conventions we’ve been following for years now. The web standards movement was not about enforcing arbitrary code syntax on poor developers who now have to type a few keys more. It is about making code predictable, extensible and easy to explain to newcomers. Confusing these matters doesn’t help the cause of making a new generation of developers embrace the web as a platform. Don’t be that guy.FeedUnfurl
NotesWhen a file is run directly from Node, require.main is set to its module. That means that you can determine whether a file has been run directly by testing require.main === moduleUnfurl
NotesStarting with Node's built in REPL, add in a completely redone inspect formatter, actual functioning separate V8 contexts, keybindings to create, switch, and delete between them, combine it with a bunch of color. ULTRA REPL Unfurl
NotesEveryone I’ve told this too tells me I’m an idiot and then a few weeks later tells me I was right and checking node_modules in to git has been a blessing to deployment and development. It’s objectively better, but here are some of the questions/complaints I seem to get.Unfurl
Notesescapes.js is a small JavaScript library for rendering ANSI art, a form of computer art that flourished in the mid 90s. ANSI art was composed by colorizing sequences of characters and blocks drawn in the built-in system font, which made it easy to transmit across telephone wires. As a result, ANSI art was especially popular on Bulletin Board Systems (BBSes).Unfurl
NotesAs designers, we all know that on-screen soft keyboards are cumbersome and rather slow to use due to their lack of physical texture and haptic feedback. And with the continual rise of touch screens on phones, tablets, and laptops, we got excited about giving the chorded keyboard another chance!Unfurl
NotesMozilla is developing a push notification system for the Firefox Web browser. It will allow users to receive notifications from websites without having to keep those sites open in their browser. The system will also be able to relay push notifications to mobile devices.Unfurl
NotesPush notifications are a way for websites to send small messages to users when the user is not on the site. iOS and Android devices already support their own push notification services, but we want to make notifications available to the whole web. We’re making prototypes and designing the API right now and want to share our progress.FeedUnfurl
NotesInstead of trying to create an interpreter from scratch, SpiderMonkey is compiled into LLVM and then emscripten translates the output into JavaScript.
js.js: A JavaScript JavaScript interpreter.Unfurl
NotesInstead of trying to create an interpreter from scratch, SpiderMonkey is compiled into LLVM and then emscripten translates the output into JavaScript.Unfurl
Notes2011 has been a great year for JavaScript. Web browsers have given us great new tools to use and we have taken web applications to new heights, competing with native applications and bringing sexy back to the web with countless impressive demos. A week or so ago, we put out a survey to all of you asking what you thought the most badass JavaScript demo of 2011 was. Of course, this would be a boring post if we just said what the outcome was, so we’re going to list the top JavaScript accomplishments of 2011 here, from demos to libraries and applications themselves. And to all of you in the JS community, Happy New Year and keep up the good work in 2012!FeedEmbedUnfurl
NotesJavaScript had a difficult childhood. It grew up in lawless neighbourhoods surrounded by gangs. It spent a lot of time listening to its parents fighting with one another about what they wanted it to be when it grew up. As any young language would, it tried hard to please its parents (and that barmy committee of uncles, and all the other random people trying to shape its future). As a result it suffers from what can only be described as behavioural quirks. Depending on which gang it’s hanging out with it will sometimes happily talk to you through its console.log, at other times refuse to say anything, and yet other times it will blow up in your face (but not tell you why).Unfurl
Notes I would like to document an emerging set of programming conventions, philosophies, and values that I see evolving in the node.js community. I call this the node aesthetic. Unfurl
NotesEmphasis provides dynamic paragraph-specific anchor links and the ability to highlight text in a document, all of which is made available in the URL hash so it can be emailed, bookmarked, or shared. Unfurl
NotesA small demo of a pleasant, yet simple label placement algorithm for densely packed visualizations. The basic idea is to have labels orbit around their target node at a fixed distance, but repeal each other, so that they don't overlap, and orient themselves to the outside of clusters. To support that, labels on the right of their target node are left-aligned, and labels on the left of their target node are right-aligned; in between, we interpolate. In this example, one force layout governs the node placement, and the second one the label placement, but of course, the node placement could be computed by any other algorithm.FeedUnfurl
NotesIn this tutorial, you will learn how to setup a complete Node.js development environment, including NPM (the Node Package Manager) and Cloud9 IDE to edit, run, and debug Node programs. The following installation instructions have been sucessfully tested on Debian 6.0 “Squeeze” and on Ubuntu 11.10 “Oneiric Ocelot”, but they should also work properly on previous versions as well.FeedUnfurl
Notes While many of you will probably disagree with me, I find the trend towards writing in languages that compile to JavaScript somewhat alarming. The most notable of these languages CoffeeScript, and it's one that has gained a good degree of traction over the last year or so.Unfurl
NotesAnd JavaScript is one of the *most* dynamic of the mainstream programming languages. Not only can you can pass any object to any function, but you can call a method with any number of arguments, easily modify the prototypes of other objects, introspect on any object's properties with a simple loop, replace any member function with a wrapped version, attach new properties to any object ... the list goes on. Unfurl
Notes Do you want a 7 KB cross-browser native JavaScript that makes your plain HTML lists super flexible, searchable, sortable and filterable? Yeah!
Do you also want the possibility to add, edit and remove items by dead simple templating? Hell yeah!Unfurl
Notes Tab Override is a plugin for WordPress and jQuery that allows tabs to be entered into textareas. In WordPress, it affects the HTML editor on admin pages. The WordPress plugin was originally written by Mathew Tinsley. Unfurl
NotesChosen is a JavaScript plugin that makes long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors.Unfurl
Notes The JavaScript library "termlib.js" provides a `Terminal' object, which facillitates a simple and object oriented approach to generate and control a terminal-like interface for web services.Unfurl
NotesSimple. Weld binds data to markup, and can generate markup based on your data. There's NO special syntax or data reshaping required. It works in the browser and in node.js! Weld is currently 3.66Kb uglified with no dependencies other than a valid DOM. Weld will apply values to elements the way that elements expect to have their values set.Unfurl
NotesInstead, we developed a JavaScript technique for dynamically scaling elements based on the current zoom factor. The technique provides a magic class name device_scale that you can apply to any element you want to remain the same size regardless of zoom.FeedUnfurl
NotesFor a node.js project I’m working on I wanted to generate a Sphinx xmlpipe2 data stream. The options for generating XML with node.js seemed a bit limited. The main contender appeared to be libmljs but it segfaulted whenever I tried to use it. So with previous experience using Tim Bray’s Genx C library I decided to write bindings for node. The result is node-genx, which is available via npm.Unfurl
NotesEmscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode (which can be generated from C/C++, using llvm-gcc or clang, or any other language that can be converted into LLVM) and compiles that into JavaScript, which can be run on the web (or anywhere else JavaScript can run). Unfurl