This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install build-essential libssl-dev curl | |
| # The install script | |
| # Adapted from https://gist.github.com/579814 | |
| echo '# Added by install script for node.js and npm in 30s' >> ~/.bashrc | |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| echo 'export NODE_PATH=$HOME/local/lib/node_modules' >> ~/.bashrc | |
| . ~/.bashrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // String utils | |
| // | |
| // resources: | |
| // -- mout, https://github.com/mout/mout/tree/master/src/string | |
| /** | |
| * "Safer" String.toLowerCase() | |
| */ | |
| function lowerCase(str) { | |
| return str.toLowerCase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ============================================================ | |
| Pakl's guide to a complete tentd and tentd-admin | |
| and Nginx proxy:80 installation. | |
| ============================================================ | |
| Oct 7, 2012 -- Version 1.2 (adds missing commands for installing nginx) | |
| History | |
| Oct 7, 2012 -- Version 1.1 (adds missing nodejs repository) | |
| Oct 7, 2021 - 1.0 initial release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var UI = require('ui'); | |
| UI.Window({ | |
| subviews:[ | |
| UI.Label({ | |
| width: Ti.UI.SIZE, | |
| height: Ti.UI.SIZE, | |
| color: "#000", | |
| text: 'here', | |
| onClick: function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| geoloqi.init({ | |
| clientId: "xxxxxxx", | |
| clientSecret: "xxxxxxx", | |
| trackingProfile: "OFF", // Don't automatically start tracking | |
| allowAnonymousUsers:false, // Don't automatically create a user when starting up the first time | |
| pushAccount: "[email protected]", // Sets the push account to use for Android notifications | |
| pushIcon: "push_icon" // Also required for Android push notifications | |
| }, { | |
| onSuccess:function(e) { | |
| if (geoloqi.session==null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this file located in /Library/Application Support/Titanium/mobilesdk/osx/{version_number} | |
| // add the following methods to GeolocationModule.mm | |
| - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region | |
| { | |
| NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:NUMBOOL(YES),@"success",[NSDictionary dictionaryWithObjectsAndKeys:NUMDOUBLE(region.center.latitude),@"lat",NUMDOUBLE(region.center.longitude),@"lng",NUMDOUBLE(region.radius),@"radius",region.identifier,@"identifier",nil],@"region",nil]; | |
| if ([self _hasListeners:@"enteredRegion"]) | |
| { | |
| [self fireEvent:@"enteredRegion" withObject:event]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Sort array of objects based on another array | |
| */ | |
| function mapOrder (array, order, key) { | |
| array.sort( function (a, b) { | |
| var A = a[key], B = b[key]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ti.include('overrideTabs.js'); | |
| /* | |
| This is a typical new project -- a tab group with three tabs. | |
| */ | |
| var tabGroup = Ti.UI.createTabGroup(); | |
| /* | |
| Tab 1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Simple demo for adding swipe detection on a table view row. Since the row is simply a container | |
| * of views, you'll want to generally create a hidden view the size of the row and add your swipe listener | |
| * to this view for detection. We need to improve Titanium so you don't have to do this in the future... | |
| */ | |
| var win = Ti.UI.createWindow(); | |
| var data = []; | |
| for (var c=0;c<10;c++) | |
| { |
NewerOlder