Tutorial by Examples: c

Simple example of using the Chrome Logging API. Template.landingPage.events({ 'click .selectItemButton':function(){ // color code and count the user interaction (blue) console.count('click .selectItemButton'); } });
Some teams find that they want to leave console log statements in their code, but not have them display in production. They will override the logging functions if a variable isn't set (possibly an environment variable). Additionally, this may qualify as a security feature in some situations. if (...
This deployment guide assumes you're using an Ubuntu server, and are either self-hosting or using an Infrastructure as a Service (IaaS) provider, such as Amazon Web Services or Rackspace. Your Ubuntu server needs to be running a daemon for launching other apps, for which we recommend the Upstart ser...
One favored approach to deploying to a server is to use Git or GitHub. This basically involves logging into your server, moving to the directory you want to run your app from, then cloning your files directly from GitHub. You then build your app on the server. This approach ensures that platform spe...
Alternatively, you may want to build your application, and then deploy it.. cd myapp meteor build --directory ../output cd .. scp output -r username@destination_host:/var/www/myapp-production
You'll need an upstart script in your /etc/init/ directory. Name it with your app's name, ending in .conf, such as /etc/init/myapp.conf. The basic upstart script looks something like this: ## /etc/init/myapp.conf description "myapp.mydomain.com" author "[email protected]&quot...
If you're running a replica set or have a need to shard your database, you'll want an upstart script that looks something like this: # /etc/init/myapp.conf description "myapp.mydomain.com" author "[email protected]" # used to be: start on startup # until we found som...
Finally, you'll need to start the Upstart daemon, and initialize your app as a service. sudo service myapp start
For server side debugging, you'll need to use a tool like Node Inspector. Before you get started, check out some of these useful tutorials. HowToNode - Debugging with Node Inspector Strongloop - Debugging Applications Easily Debugging Meteor.js Walkthrough with Screenshots of Using Node Inspecto...
Static server assets must be placed in the private directory. Text files Text files can be accessed by using the Assets.getText(assetPath, [asyncCallback]) method. For example, the following JSON file is named my_text_asset.json and is located in the private directory: { "title": &...
// thecontroller.js $scope.sendVerifyEmail = function() { console.log('Email sent, whaaaaam!'); currentAuth.sendEmailVerification(); } // where currentAuth came from something like this: // routerconfig .... templateUrl: 'bla.html', resolve: { currentAuth:['Auth', functio...
layout_text_to_speech.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:pad...
Ensure that you install the correct npm dependencies (babel decided to split itself into a bunch of packages, something to do with "peer dependencies"): npm install webpack webpack-node-externals babel-core babel-loader babel-preset-react babel-preset-latest --save webpack.config.js: mo...
This is very common, you memorize a path to a file or folder, you open up Vim and try to write what you've just memorized, but you are not 100% sure it's correct, so you close the editor and start over. When you want the path completion feature, and you have a file /home/ubuntu/my_folder/my_file a...
. represents the current line but it can also be omitted entirely. $ represents the last line. % represents the whole buffer, it is a shortcut for 1,$. The two commands below execute :command on every file from the current line to the last line: :.,$command :,$command The command below e...
The commands below execute :command on every line from the first matching from to the first matching to: :/from/,/to/command " from next 'from' to next 'to' :?from?,/to/command " from previous 'from' to next 'to' :?from?,?to?command " from previous 'from' to previous 'to' ...
SELECT DISTINCT ContinentCode FROM Countries; This query will return all DISTINCT (unique, different) values from ContinentCode column from Countries table ContinentCodeOCEUASNAAF SQLFiddle Demo
:s/foo/bar Replace the first instance of foo with bar on the current line. :s/foo/bar/g Replace every instance of foo with bar on the current line. :%s/foo/bar/g Replace foo with bar throughout the entire file.
* on the word you want to substitute. :%s//replacement/g, leaving the find pattern empty.
Using built-in colormaps is as simple as passing the name of the required colormap (as given in the colormaps reference) to the plotting function (such as pcolormesh or contourf) that expects it, usually in the form of a cmap keyword argument: import matplotlib.pyplot as plt import numpy as np ...

Page 276 of 826