Tutorial by Examples

If your application is going to run on different devices, it's going to need to render to different ViewPorts, based on the device size. You can deal with this in two ways: with javascript rules, or CSS media styles. If you've been using a MVC or MVVM library, such as Angular or Ember (or Blaze, for...
If you're going to be designing layouts with fixed size screens for different mobile devices, you may want to mirror that design when running your app on a desktop. The following method fixes the size of the window OUTSIDE of PhoneGap, giving a fixed-sized window on the desktop. Sometimes it's easie...
To get all of this to work, you'll probably need offline support, which means caching application data and user data. meteor add appcache meteor add grounddb
On desktop apps, you may want to disable scroll-bounce, to give your app a more native feel. You can do this with javascript, by disabling how the browser controls the DOM: // prevent scrolling on the whole page // this is not meteorish; TODO: translate to meteor-centric code document.ontouchmove...
Mobile devices generally don't have keyboards, so you'll need to add some haptic controllers to your application. The two popular packages that people seem to be using is FastClick and Hammer. Installation is easy. meteor add fastclick meteor add hammer:hammer FastClick requires nearly no confi...
Before you compile your app and run it on your device, you'll need create some icons and splash screens, and add a mobile-config.js file to your app. App.icons({ // iOS 'iphone': 'resources/icons/icon-60x60.png', 'iphone_2x': 'resources/icons/[email protected]', 'ipad': 'resources/icons...
Now it's time to go through the Meteor Cordova Phonegap Integration documentation. Since that documentation was written, XCode and Yosemite have been released, which has caused some hiccups in installation. Here are the steps we had to go through to get Meteor compiled to an iOS device. Upgrade ...
Register your Apple Developer Account Register an App ID for your app Register the UUID of your testing devices Generate an iOS App Development provisioning profile Generate a CertificateSigningRequest from KeychainAccess Submit CertificateSigningRequest to https://developer.apple.com/accou...
Make sure your development workstation and iPhone are connected to the same WiFi network. Tethering, hotspots, and other ad-hoc networking won't work. Run sudo meteor run ios-device Deploy to your device!
You'll need to separate out your application layer from your database layer, and that means specifying the MONGO_URL. Which means running your app through the bundle command, uncompressing it, setting environment variables, and then launching the project as a node app. Here's how... #make sure you...
Then go into the mongo shell and initiate the replica set, like so: mongo > rs.initiate() PRIMARY> rs.add("mongo-a") PRIMARY> rs.add("mongo-b") PRIMARY> rs.add("mongo-c") PRIMARY> rs.setReadPref('secondaryPreferred')
The replica set will need an oplog user to access the database. mongo PRIMARY> use admin PRIMARY> db.addUser({user:"oplogger",pwd:"YOUR_PASSWORD",roles:[],otherDBRoles:{local:["read"]}}); PRIMARY> show users
Your upstart script will need to be modified to use multiple IP addresses of the replica set. start on started mountall stop on shutdown respawn respawn limit 99 5 script # our example assumes you're using a replica set and/or oplog integreation export MONGO_URL='mongodb://mongo-a...
Oplog Tailing on Sharded Mongo
There's two great utilities for black-box analysis of databases. First is variety.js, which will give you a high-level overview. The second is schema.js, which will let you dig into the collections for more detail on the individual fields. When inheriting a production Mongo database, these two util...
The --url flag can be tricky to use. There is a 60 second window to authenticate, and then the username/password randomly resets. So be sure to have robomongo open and ready to configure a new connection when you run the command. # get the MONGO_URL string for your app meteor mongo --url $METEOR...
Same thing as before, but you have to copy the info into the mongodump command. You have to run the following commands rediculously fast, and it requires hand/eye coordination. Be warned! This is a rediculously hacky! But fun! Think of it as a video game! :D # get the MONGO_URL string for your app ...
This command will create a /dump directory, and store each collection in a separate BSON blob file. This is the best way to backup or transfer databases between systems. mongodump --db meteor
The analog to the meteordump command is meteorrestore. You can do a partial import by selecting the specific collection to import. Particularly useful after running a drop command. # make sure your app is running meteor # then import your data mongorestore --port 3001 --db meteor /path/to/dump...
Run meteor, open another terminal window, and run the following command. mongoexport --db meteor --collection foo --port 3001 --out foo.json

Page 493 of 1336