##Chai Expect
##Language Chains
- to
- be
- been
- is
- that
- and
- have
| Go to Bitbucket and create a new repository (its better to have an empty repo) | |
| git clone git@bitbucket.org:abc/myforkedrepo.git | |
| cd myforkedrepo | |
| Now add Github repo as a new remote in Bitbucket called "sync" | |
| git remote add sync git@github.com:def/originalrepo.git | |
| Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync" | |
| git remote -v |
##Chai Expect
##Language Chains
| // Register for an Account ☞ http://cloudinary.com/invites/lpov9zyyucivvxsnalc5/n8b98rtyuredob4geg2z | |
| // replace these | |
| var cloudinaryCloudName = 'Your_Cloud_Name'; | |
| var cloudinaryAPIKey = 999999999999; | |
| var cloudinaryAPISecret = 'XXXXXXXXXX-XXXXX-XX'; | |
| // call this function & pass in TiBlob Object | |
| function cloudImageClean(rawImage) { | |
| var nowUnix = moment().unix(); // requires momentjs |
If you want to your CommonJS modules to work in both Alloy and plain Titanium projects, you might need a way to detect if you're in Alloy. For instance, if you're in Alloy you would get Underscore from the alloy-module, while in plain Titanium you would require Underscore directly.
Well, you can:
var _ = require((typeof ENV_TEST === 'boolean') ? 'alloy' : 'underscore')._;
The above works by utilizing Alloy's optimization process. In this process, constants like ENV_TEST will be either TRUE or FALSE. The actual expressions in wich they are used will then be evaluated. If FALSE the code block will be removed. In plain Titanium projects the constants are undefined and this typeof ENV_TEST will be undefined, so the code block will be executed.
| /* Sample JavaScript file added with ScriptTag resource. | |
| This sample file is meant to teach best practices. | |
| Your app will load jQuery if it's not defined. | |
| Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7. | |
| Your app does not change the definition of $ or jQuery outside the app. | |
| Example: if a Shopify theme uses jQuery 1.4.2, both of these statements run in the console will still return '1.4.2' | |
| once the app is installed, even if the app uses jQuery 1.9.1: | |
| jQuery.fn.jquery => "1.4.2" | |
| $.fn.jquery -> "1.4.2" | |
| */ |
| var rootWin = Ti.UI.createWindow(); | |
| var navGroup = Ti.UI.iPhone.createNavigationGroup({ | |
| window: rootWin | |
| }); | |
| var button = Ti.UI.createButton({ | |
| title: 'Open ListView Tests' | |
| }); | |
| button.addEventListener('click', function() { | |
| openTestsWindow(); | |
| }); |
| // add all items to collection | |
| Alloy.Collections.Fugitive.reset([{ | |
| "name" : "Jeff Haynie" | |
| }, { | |
| "name" : "Nolan Wright" | |
| }, { | |
| "name" : "Don Thorp" | |
| }, { | |
| "name" : "Marshall Culpepper" | |
| }, { |
| /* Parse a string function definition and return a function object. Does not use eval. | |
| * @param {string} str | |
| * @return {function} | |
| * | |
| * Example: | |
| * var f = function (x, y) { return x * y; }; | |
| * var g = parseFunction(f.toString()); | |
| * g(33, 3); //=> 99 | |
| */ | |
| function parseFunction (str) { |
| <!doctype html> | |
| <title>Site Maintenance</title> | |
| <style> | |
| body { text-align: center; padding: 150px; } | |
| h1 { font-size: 50px; } | |
| body { font: 20px Helvetica, sans-serif; color: #333; } | |
| article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
| a { color: #dc8100; text-decoration: none; } | |
| a:hover { color: #333; text-decoration: none; } | |
| </style> |