background preloader

Package.json: an interactive guide

Package.json: an interactive guide

Running Meteor on Your Own Server JSON JSON (JavaScript Object Notation) is a data-interchange format. It closely resembles a subset of JavaScript syntax, although it is not a strict subset. (See JSON in the JavaScript Reference for full details.) JSON is capable of representing numbers, booleans, strings, null, and arrays (ordered sequences of values) and objects (string-value mappings) composed of these values (or of other arrays and objects). Using JSON through JavaScript's JSON object The simplest, easiest way to use JSON is through the standard JSON object in JavaScript. For example, to serialize a JavaScript object, use the JSON.stringify() method: var foo = {}; foo.bar = "new property"; foo.baz = 3; var JSONfoo = JSON.stringify(foo); var backToJS = JSON.parse(JSONfoo); For more information, see the JSON object documentation. toJSON() method If an object defines a toJSON() method, JSON.stringify will call that method to determine the object's JSON representation. json1 now contains '"bar"'. Limitations See also nsIJSON

HOWTO prototype and iterate for fun and profit In this 30+ minute video, Firefox creative lead Aza Raskin explains why you'd want to do iterative prototyping and how you do it in order to get from idea to execution. I think that the Internet's ability to support and sustain low-cost iteration is its signal virtue, but this virtue is often missed by bigger, older institutions that are accustomed to high failure costs (e.g., you print a million of the wrong book or make a million of hte wrong shirt, it's a big deal; you serve a million of the wrong page and change the design, it's business as usual). For those who do not want to sit through the 30-minutes romp and my rapid prototyping, here are the principals of prototyping that I explain fully in talk: 1. How To Prototype And Influence People (via O'Reilly Radar)

onmodulus/demeteorizer Pass Values From the Page to AngularJs - Jake Trent There are simple mechanisms for passing data from your web page to AngularJs. One directive is called ngInit. You may well need it. The Use Cases The use cases don’t make a ton of sense without a concrete example. There are several ways to implement even the most simple example. For our purposes, let’s say that we’re displaying a list of comments on the screen. Angular Requests Data It’s easy to put data into scope for AngularJs to use if Angular is the one to request the data initially. Then your template will automatically have the data in scope. Now when we add a new comment via Ajax, we can push it right into the comment collection, and the page is updated by Angular with the appropriate data. Server Renders Data Initially Sometimes it’ll make sense for the server to render the data. If the server was to initially print the comments, like so: We still might want to do AJAX’y things with a comment, such as like it. ngInit Passes Angular Server Data From the ngInit docs:

Tigris.org: Open Source Software Engineering Run Meteor Apps Anywhere with Demeteorizer Meteor is an ambitious project that aims to reduce the amount of time it takes to write and deploy high-quality apps. I would compare it to Rails if I weren’t afraid of the response I would get to saying something like that, so let’s just call it a set of tools and a JavaScript framework. At its core, Meteor apps sit on top of Node.js, which means we should technically be able to run a Meteor app anywhere Node will run. This is mostly true by using Meteor’s built-in “bundle” command, however it doesn’t produce something that’s extremely portable. This is why we created Demeteorizer. Demeteorizer wraps and extends Meteor’s bundle command by creating something that more closely resembles a standard looking Node.js application, complete with a package.json file for dependency management. Installing $ npm install -g demeteorizer Usage demeteorizer [options] $ cd /my/meteor/app $ demeteorizer -o ~/my-meteor-apps/converted -n v0.8.24 Options Example $ meteor create --example leaderboard $ demeteorizer

Make Jsonp Requests with AngularJs - Jake Trent There are a couple ways to make cross domain requests from a client browser. One method is called Jsonp or Json with padding. The AngularJs library makes this really simple. Web Server Support First of all, your Jsonp request will be worth nothing if the server you’re requesting data from does not support it. But that’s kind of a weird name. This essentially is a browser hack to get around the security constraint of browsers not being able to request non-script items from different domains. Angular Jsonp You’re probably already used to using the $http service. The client script also requires that we specify the callback to send data to. All that jibber jabber for this simple example of a script asking for Tumblr data: The interesting line is line one.

How I know when the requirements process is complete By Alvin Alexander. Last updated: Mar 22, 2014 Summary: How to know when a software requirements specification is complete by using Function Point Analysis techniques. I've written dozens -- maybe hundreds -- of software requirement specifications over the years, and at one point in my career I learned an important little secret about knowing when the process of gathering requirements for a software requirements specification was really complete. Here's my secret. How I know when the software requirements specification is really complete As a business analyst, I'm lucky to have trained myself in the techniques of Function Point Analysis (FPA). By this, I mean that when a customer comes to me and gives me a 10,000-foot overview of what they want, and we follow that initial meeting with some requirements gathering meetings, I know that I have all the requirements for the problem very simply: I know the requirements process is complete when I can accurately count the Function Points. Summary

Keep a node.js server up with Forever One of the great benefits of using node.js is the reduction in dependencies needed to run a production web application. By using the 'http' module we can run a stand-alone web server in node.js without the need for a separate server like Apache or nginx. The caveat of not having to use these servers is that their concerns are now the concerns of the node.js application developer. The concern that we will discuss in this article is that of fault tolerance, or how to automatically restart your server when it crashes or enters an invalid state. Before we dive into how to use Forever, lets setup the 'hello world' web server that we will later run with Forever. The above code starts a web server that will respond to all requests with 'hello, i know nodejitsu'. $ node simple-server.js > hello world running on port 8000 $ nohup node simple-server.js > output.log & [1] 23909 This will start our server process in the background and append all output to 'output.log'. [sudo] npm install forever

Preload Route Data in Angular - Jake Trent It’s sometimes useful to be able to preload or resolve data previous to an Angular view being displayed. Such was the case recently for our current user object. It simplified a lot of things in the app to have the guarantee of a loaded current user previous to displaying pages. The Angular router has a great mechanism built in to do just this sort of thing, called resolve. Current User For the example, our current user object is super simple. Note that for our app there is just one CurrentUser object, a singleton, because we return a single instance from our factory, not a class. Router The Angular router is used for client-side routing of urls. Let’s say that we have a home page and a profile page for our example. Each route can be configured with a resolve object. The run method is essentially the Angular app’s main method, starting the program. Resolve Function In our resolve function we setup our own promise via the $q service. Application Controller When to Use

Function point A function point is a unit of measurement to express the amount of business functionality an information system (as a product) provides to a user. The cost (in dollars or hours) of a single unit is calculated from past projects.[1] As of 2013[update], there are several recognized standards and/or public specifications for sizing software based on Function Point 1. ISO Standards COSMIC: ISO/IEC 19761:2011 Software engineering. 2. OMG, an open membership and not-for-profit computer industry standards consortium, has adopted the Automated Function Point (AFP) specification led by the Consortium for IT Software Quality. Introduction[edit] Function points were defined in 1979 in Measuring Application Development Productivity by Allan Albrecht at IBM.[3] The functional user requirements of the software are identified and each one is categorized into one of five types: outputs, inquiries, inputs, internal files, and external interfaces. Benefits[edit] Criticism[edit] See also[edit] References[edit]

Complete NPM integration for Meteor - MeteorHacks Npm support for Meteor comes to the light from version 0.6.0. But it gives complete NPM access to packages only. If you need to use npm modules like redis, aws-sdk, colors, winston in your app, you are out of luck. Of course, you can wrap npm modules in a package or use if it is available on atmosphere, but that’s kind a hard. Here comes the solution I could be able to trick meteor a bit, and now we can have complete access to npm modules from Meteor. Adding NPM support to your app Via Meteorite mrt add npm If you are working on multiple meteor projects at the sametime or using different versions, try to use following method instead installing it with meteorite Via NPM npm install -g meteor-npm meteor-npm This creates a package named npm inside your project and it has no link with meteorite. Create packages.json file Then create packages.json file on your project root. Note that it is packages.json, not package.json Let’s use a npm module Let’s get some gists using the github npm module.

Related: