
Designing Javascript APIs We at Filepicker.io spend a lot of time thinking about APIs. With the release of our Version 1.0 javascript API, we thought about best practices for javascript API design, and wanted to share them so that when we use your API, it’ll be just as awesome as when you use ours. Rules of your Javascript API Rule 0: Never make breaking changes to your API. Unless you must. An API is a contract between you and the developers who use your product. The developers building on your API have invested time and energy into learning how to use your product and integrating it into theirs. However as your knowledge about how people are using your product and API grows, the original API will become stale and a refresh will be in order. Over the course of our early customer development during YC, the product and feature set was changing so fast it essentially meant we just piled more and more on to the API. Rule 1: Provide wood and nails, and a complete house for your API Use your API as you’re building it.
Canvas + - CSRF protection and Single Page Apps You're in luck! Just about 2 weeks ago I was asked the same question, and after a bit of head-scratching, I came up with the following. Please keep in mind that this is not well peer-reviewed, so we'll see how the comments and voting goes. 1. Once you receive the first request to load your application, generate a secure random identifier and store it in a session variable on the server, then send it to the client. <script>setToken('<% print SESSION[TOKEN] %>');</script></body> Your setToken() would assign the token value to the variable in which you'd keep the token. 2. With each request you'd add that token to the list of parameters, like token=TOKEN, and the serve would check it against the one stored in the session variable. 3. It's not really mandatory, but it's a good idea to refresh the token every once in a while, say 15 minutes. Note: A key element in the process is HTTPS usage.
Flash Pro & CreateJS Following that is the handleComplete method. This remains almost identical to what was published, except that now it removes the Platypus instance that was on stage. We’ve also enabled touch interactions on our stage, so this game can be played on an iOS device. Quick Tip: In a more complex project, you’d likely get rid of the exportRoot , and add elements to the stage directly. Another important change we’ve made is to change the Ticker listener from stage to our tick function. Quick Tip: I’m keeping things simple here, but generally you should create a class that encapsulates your logic and register a method on it with Ticker, instead of polluting the global (window) scope. Adding game logic The tick function is called 20 times per second, and is the heartbeat of the game. First, if a random value is less than 0.01 (1% chance) then we create a new platypus, push it into our platypii array, set its display properties, give it a velocity, and add it as a child of the stage.
reviews of some MVC frameworks UPDATE 1/14/2012: Added Batman.js and Angular.js due to popular demand and because they looked impressive. Over the last several months I have been in a constant search for the perfect javascript MVC framework. Driven by a dire need for the right level of abstraction and features, I have tried out - some more cursorily than others - every framework I could get my hands on. Specifically, the following four features are very important to me: UI Bindings - I'm not just talking about templates, I'm talking about a declarative approach to automatically updating the view layer when the underlying model changes. The Contenders Here is a table showing all of the frameworks support for the above features. 1. Backbone.js is the web's darling framework. Pros: Strong community and lots of momentum. Cons: Lacks strong abstractions and leaves something to be desired. 2. SproutCore is what Apple used on its iCloud initiative. Pros: Bindings support. Cons: Overly prescriptive. 3. Cons: Too simple. 4. 5.
Code Conventions This is a set of coding conventions and rules for use in JavaScript programming. The long-term value of software to an organization is in direct proportion to the quality of the codebase. Over its lifetime, a program will be handled by many pairs of hands and eyes. If a program is able to clearly communicate its structure and characteristics, it is less likely that it will break when modified in the never-too-distant future. All of our JavaScript code is sent directly to the public. JavaScript Files JavaScript programs should be stored in and delivered as .js files. JavaScript code should not be embedded in HTML files unless the code is specific to a single session. Whitespace Where possible, these rules are consistent with centuries of good practice with literary style. Blank lines improve readability by setting off sections of code that are logically related. Blank spaces should always be used in the following circumstances: while (true) { Avoid excessively long lines. Use line comments. Is
Spine Buyer Protection Program When you buy a domain name at Dan.com, you’re automatically covered by our unique Buyer Protection Program. Read more about how we keep you safe on our Trust and Security page. Next to our secure domain ownership transfer process, we strictly monitor all transactions. If anything looks weird, we take immediate action. Fast & easy transfers 98% of all domain ownership transfers are completed within 24 hours. Hassle free payments Pay by bank wire and get a 1% discount or use one of the most popular payment options available through our payment processor, Adyen. Centiped testé sur. Flex to HTML5 Considerations The web application landscape has shifted rapidly in the past six months. Due to Adobe’s changing view of the Flash Platform, many companies who have relied on technologies like Flex are looking to migrate to HTML5. This transition can be tricky both for an organization as well as its developers. 1. Many developers will quickly become overwhelmed when examining the options for HTML5 web application frameworks. Within JavaScript you will find frameworks that differ greatly on each of these points. There are several key points to consider when making this decision for your organization: How documented is the framework? If your company is attempting to decide on an MVC architecture, I would recommend examining Backbone JS, Ember JS, Angular JS, and ExtJS / Sencha Touch. In addition, your team can augment the framework that you have chosen over time. 2. A DOM (Document Object Model) manipulation and AJAX library is an essential tool in JavaScript development. 3. 4. 5. Conclusion
Test plan