Tutorial by Examples

After creating an API wrapper, it's likely that you may want to create an Atmosphere package to redistribute it and share it between applications. The files of your package will probably look something like this. packages/foo-api-wrapper/package.js packages/foo-api-wrapper/readme.md packages/foo-...
At this point, you're still building your package, so you'll need to add the package to your application: meteor add myaccount:foo And eventually publish it to Atmosphere: meteor publish myaccount:foo
Now that we have all those pieces put together, you should now be able to make calls like the following from within your app: Foo.identify('John'); Foo.record_action_on_item('view', "HackerNews'); Obviously you'll want to adjust function names, arguments, urls, and the like, to create the ...
Uploading files can be easy or really complicated, depending on what you're wanting to do. In general, transfering a file itself isn't all that difficult. But there are lots of edge cases around attachments, binary files, and the like. And the real sticking point is horizontal scaling, and creating ...
If we want something a bit more polished, with an integrated Dropzone UI and a REST endpoint, we're going to need to start adding custom REST routes and packages with UI helpers. Lets begin by importing Iron Router and Dropzone. meteor add iron:router meteor add awatson1978:dropzone And conf...
To scale things, we have to stop using local storage on our server, and start using either a dedicated file storage service or implement a horizontal storage layer. The easiest way to get started with scalable file storage is to use a solution like Filepicker.io, which supports S3, Azure, Rackspace,...
However, if you're really serious about storage, and you want to store millions of images, you're going to need to leverage Mongo's GridFS infrastructure, and create yourself a storage layer. For that, you're going to need the excellent CollectionFS subsystem. Start by adding the necessary packages...
The following scripts are for uploading a file from the server filesystem into the server. Mostly for config files and filewatchers. //https://forums.meteor.com/t/read-file-from-the-public-folder/4910/5 // Asynchronous Method. Meteor.startup(function () { console.log('starting up'); ...
$ cat ip.txt address range substitution pattern sample Nth line $ sed -n '2p' ip.txt range $ sed '3d' ip.txt address range pattern sample Last line $ sed -n '$p' ip.txt sample
Add React to your project: meteor npm install --save react react-dom react-mounter Create the client/helloworld.jsx file to display a simple React component: import React, { Component } from 'react'; import { mount } from 'react-mounter'; // This component only renders a paragraph containin...
It's possible to send broadcast to BroadcastReceiver with adb. In this example we are sending broadcast with action com.test.app.ACTION and string extra in bundle 'foo'='bar': adb shell am broadcast -a action com.test.app.ACTION --es foo "bar" You can put any other supported type to b...
We can also use macros for making code easier to read and write. For example we can implement macros for implementing the foreach construct in C for some data structures like singly- and doubly-linked lists, queues, etc. Here is a small example. #include <stdio.h> #include <stdlib.h>...
def str = 'nice' assert "Groovy is $str" == 'Groovy is nice'
def arg = [phrase: 'interpolated'] assert "This is $arg.phrase" == 'This is interpolated'
def str = 'old' def interpolated = "I am the ${str} value" assert interpolated == 'I am the old value' str = 'new' assert interpolated == 'I am the old value'
We can have lazy interpolation in Strings. This is different than normal interpolation as the GString can potentially have different values, depending on the closure, whenever it is converted into a String. def str = 'old' def interpolated = "I am the ${ -> str} value" assert interpo...
def str = 'dsl' def interpolated = "Groovy ${str.length() + 1} easy ${str.toUpperCase()}" assert interpolated == 'Groovy 4 easy DSL' str = 'Domain specific language' assert interpolated == 'Groovy 4 easy DSL'
<style name="AppTheme" parent="Theme.AppCompat"> <item name="android:colorEdgeEffect">@color/my_color</item> </style>
5.0 The ripple animation is shown when user presses clickable views. You can use the same ripple color used by your app assigning the ?android:colorControlHighlight in your views. You can customize this color by changing the android:colorControlHighlight attribute in your theme: This effect colo...
This attribute can change the background of the Status Bar icons (at the top of the screen) to white. <style name="AppTheme" parent="Theme.AppCompat"> <item name="android:windowLightStatusBar">true</item> </style>

Page 406 of 1336