background preloader

Javascript

Facebook Twitter

Blazing fast node.js: 10 performance tips from LinkedIn Mobile. In a previous post, we discussed how we test LinkedIn's mobile stack, including our Node.js mobile server. Today, we’ll tell you how we make this mobile server fast. Here are our top 10 performance takeaways for working with Node.js: 1. Avoid synchronous code By design, Node.js is single threaded. To allow a single thread to handle many concurrent requests, you can never allow the thread to wait on a blocking, synchronous, or long running operation. A distinguishing feature of Node.js is that it was designed and implemented from top to bottom to be asynchronous.

Unfortunately, it is still possible to make synchronous/blocking calls. Our initial logging implementation accidentally included a synchronous call to write to disc. 2. The Node.js http client automatically uses socket pooling: by default, this limits you to 5 sockets per host. 3. For static assets, such as CSS and images, use a standard webserver instead of Node.js. 4. 5. 6. 7. 8. 9. 10. Try it out. Blazing fast node.js: 10 performance tips from LinkedIn Mobile. Des développeurs libèrent le code source d’un jeu mobile en HTML5, et mettent en lumière les défis. Inspiré par le buzz autour de l’HTML5, le studio de développement de jeu Wooga, a récemment tenté de créer un jeu mobile complet avec les technologies Web basées sur des normes. Pour partager les résultats de leur l’expérience durant l’année de développement, la société a publié le code source du jeu sur GitHub en vertu d’une licence de logiciel Open Source.

Wooga a également publié un article sur son blog, dans lequel il décrit quelques-unes des leçons que les développeurs de la société ont retirées à travers cette expérience de développement. La société voit un potentiel considérable en matière de jeu HTML5, mais indique que la technologie n’est pas tout à fait prête. Wooga publie le code source avec l’espoir qu’il contribuera à faire grandir la connaissance dans le coeur de la communauté du développement Web. Comme je l’avais signalé plus tôt cette année, Mozilla et Google ont tous deux pris un vif intérêt dans leur navigateur respectif en basant ce dernier sur les jeux.

JS Game engines

Examples and demos · bartaz/impress.js Wiki. Breakpoints.js - XOXCO - Web and Community Development. Introduction to Backbone.js Part 5: AJAX – Video Tutorial. Hovercard - a jQuery plugin with built in Twitter and Facebook cards. Hover over the red text to see the hovercard in action: jQuery is a cross-browser JS library designed to simplify the client-side scripting of HTML. It was released in January of 2006 by John Resig is an application developer at Khan Academy. He was a JavaScript tool developer for the Mozilla Corporation. He is also thecreator and lead developer of the jQuery JavaScript library. at BarCamp NYC. jQuery is free, open source software, dual-licensed under the MIT License and GNU General Public License, Version 2.[4] jQuery's syntax is designed to make it easier to navigate a document, select DOM elements, create animations, handle events, and develop Ajax applications. View Source <p>jQuery is a cross-browser JS library designed to simplify the client-side scripting of HTML.

JSTweener – CodeRepos::Share – Trac. 8 Amazing Javascript Experiments of Physic and Gravity Simulation. Working with Paper.js. Paper.js offers different approaches for its integration in the browser. The simplest way is to use PaperScript, our extension of JavaScript that facilitates a few things along the way. For more advances users or bigger projects it might be preferable to work directly with JavaScript, as described in the tutorial about Using JavaScript Directly. What is PaperScript?

PaperScript is the plain old JavaScript that you are used to, with added support of mathematical operators (+ - * / %) for Point and Size objects. PaperScript code is automatically executed in its own scope that without polluting with the global scope still has access to all the global browser objects and functions, such as document or window. By default, the Paper.js library only exports one object into the global scope: the paper object. PaperScript also offers automatic creation of Project, View and mouse Tool objects, and simplifies the installation of event handlers for these.

Script Configuration Please note: Login - jsFiddle - Online Editor for the Web (JavaScript, MooTools, jQuery, Prototype, YUI, Glow and Dojo, HTML, CSS) JSTweener – CodeRepos::Share – Trac. News Analytics: Analytic Tools for Quantitative Finance, Business &amp; More - Recorded Future. Get started with object-oriented JavaScript code. 40 Useful JavaScript Libraries | Strong Life. Dashcode Invader: Using Dashcode To Create A Game. In this tutorial, we will continue building a simple space-invader type game.

We will be continuing from the tutorial presented in Part1 at however, we are making some major changes, and I’ll explain why. The first change has to do with restructuring the CSS code so that most of the objects within the game are nested inside a div element. The reason for this is to make it easier to add game elements into the game by using addChild to add into a div container. The index.html should be modified to look like this: [c] <! Hierarchically, the main container is "content" div. The main.css should be modified to look like this: We assigned the images, which were previously embedded in the html, as background-image of the div style-sheets.

We are also modifying the main.js by adding a new function named onMouseMoveHandler(). You can see the result playing in the browser below (I tested with Firefox 3 and iPhone Simulator on the Mac). JS. How to Scrape Web Pages with Node.js and jQuery. Node.js is growing rapidly; one of the biggest reasons for this is thanks to the developers who create amazing tools that significantly improve productivity with Node. In this article, we will go through the basic installation of Express, a development framework, and creating a basic project with it.

What We're Going to Build Today Node is similar in design to, and influenced by, systems like Ruby's Event Machine or Python's Twisted. Node takes the event model a bit further - it presents the event loop as a language construct instead of as a library. In this tutorial, we will scrape the YouTube home page, get all the regular sized thumbnails from the page as well as links and video duration time, send all those elements to a jQueryMobile template, and play the videos using YouTube embed (which does a nice job of detecting device media support (flash/html5-video). You should also refer to our "Node.js: Step by Step" series. Step 1: Setting Up Express So what exactly is Express? Request app.js. Creating a basic site with node.js and Express. A walkthrough on how to create and deploy a basic site with Node.js and the Express framework What we are going to do This walkthrough will go over setting up a basic site using Node.js and Express. The walkthrough is aimed at beginners exploring Node.js as I've had many questions from friends and colleagues about creating and deploying node apps.

If you are not a beginner the article probably won't be of much use to you. Here is the site we are going to create. Setup First we need to setup our development environment. If you are on Linux there are plenty of articles on Google. For Windows users there are also resources on Google but it is a bit more tricky. Prerequisites If everything has installed ok you should now have Node.js and npm running on your machine. Node -v v0.8.21 npm -v 1.2.12 Create an Express site Still with me? First let's install express npm install -g express-generator The -g flag means that you are installing express globally on your system. express -c stylus express_example.

Visionmedia/jade - GitHub. A Simple MVC Setup In Node.JS. I’m sure many of you have heard about the new server side javascript project called node.js. I’ve been using myself to build full stack dynamic websites and find it a very nice environment to create a dynamic website. When I first started out I had no idea what sort of way one should create an MVC style framework with node or what modules would help me to achieve the model, view, controller ideal.

Heres my stack: Node.js ( of courseNPM ( to easily install packages for node.Express ( – a very nice web development framework built on connect (allows “controllers”)Mongoose ( – a solid orm for mongodb in node.js that just released a much improved version (allows “models”)Jade ( – a template engine for node that allows some cool shorthand (allows “views”)Other tools were used of course but those were the essentials. The application directory looks something like this: Force-Directed Graph. This simple force-directed graph shows character co-occurence in . A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen . Data based on character coappearence in Victor Hugo’s , compiled by Donald Knuth . Source Code. YUI+YQL Twitter example - jsFiddle - Online Editor for the Web (JavaScript, MooTools, jQuery, Prototype, YUI, Glow and Dojo, HTML, CSS)

Closure Library API Documentation (Closure Library API Documentation - JavaScript) d3.js. JSFIDDLE. 10 Impressive JavaScript Animation Frameworks. Complex and slick JavaScript-based animation has been made easier with the emergence of frameworks and libraries that give developers the ability to create stunning and eye-grabbing animation and transition effects that make it easy these complex tasks. In this article, you will read about the top 10 JavaScript-based animation frameworks and libraries that will enable you to create engaging and captivating user experiences. 1. $fx $fx is a compact and lightweight JavaScript animation library which extends native JavaScript DOM methods with its own animation methods and functions. Its small file size (weighing in at only 3.7 KB), hassle-free implementation, and low learning curve makes $fx a powerful option for adding eye-popping animation effects to your web projects. Check out the Examples section on the Manuals page to see the library in action. 2. jsAnim 3. scripty2 scripty2 is a flexible and lightweight JavaScript animation framework for developing delicious visual effects. 5. 6. 7. 8.

$fx - JavaScript animation library. Processing.js. Processing.js. Plovr. Xib2Js « Frog on Mobile. Xib2Js for Titanium Mobile is Mac OSX application to convert the .xib file to the JavaScript codes. And TiMock is Titanium Mobile Application to communicate with xib2js and render the code to it’s screen. Build your UI with Xcode and just drag and drop the .xib file to the xib2js then the JavaScript code will be automatically generated. Then execute TiMock on your device or simulator and it will communicate with xib2js, so you can check how your UI looks like on actual device. The .xib parser is not good enough to generate the whole things perfectly so please do not expect too much but it will be much more easy to start creating Titanium application rather than writing the JavaScript code from scratch. Please download from the following and give your feedback via twitter about this application. [Application] xib2js2.0.dmg You need to build the TiMock by your self.

[Source code] The source code of xib2js is available here . The source code of TiMock is available here . [Documents] Lessons learned porting from jQuery to Closure. Jquery. 20+ Useful jQuery Google Maps Tutorials and Plugins. jQuery Google maps has become extremely popular among the internet users primarily for its easy-to-use techniques those are needed to locate a particular position on the world map. Let us discuss some of the tutorials, resources as well as plugins of jQuery Google maps. There are plugins available which are used to include the longitude, latitude as well as text (for the name of a particular place) on the Google maps. In order to do that the user needs to reserve or book an API key available online. If any user wants to add Google maps to his website, jQuery plugin are used. However, these plugins can be used to make the webpage free from any unnecessary feature in order to make the page look sleek and tidy.

You just need to click on these markers the user will get options of tiny maps displayed on the screen. There are jQuery Google maps tutorials which help the users to learn how to embed the reviews as well as various types of articles those contain wide range of information. Category:String similarity measures. Node.js. Tutorials: Aptana Jaxer. JSON in JavaScript. JavaScript is a general purpose programming language that was introduced as the page scripting language for Netscape Navigator. It is still widely believed to be a subset of Java, but it is not.

It is a Scheme-like language with C-like syntax and soft objects. JavaScript was standardized in the ECMAScript Language Specification, Third Edition. JSON is a subset of the object literal notation of JavaScript. Since JSON is a subset of JavaScript, it can be used in the language with no muss or fuss. In this example, an object is created containing a single member "bindings", which contains an array containing three objects, each containing "ircEvent", "method", and "regex" members.

Members can be retrieved using dot or subscript operators. myJSONObject.bindings[0].method // "newURI" To convert a JSON text into an object, you can use the eval() function. eval() invokes the JavaScript compiler. Var myObject = eval('(' + myJSONtext + ')'); The eval function is very fast. Scripty2 - Puzzles. JS.