This file contains 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
/** | |
TiUIScrollableView.m | |
Currently, ScrollableViews do not listen for x,y changes during scroll events (touchmove). This mod fixes that. It adds additional x,y coords to the scroll event, similar to scrollViews. | |
Outputs: | |
currentPage = 0; | |
source = "[object TiUIScrollableView]"; | |
type = scroll; |
This file contains 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
/** | |
Create Thumbnail of Video File | |
This snippet captures a thumbnail JPG image, based on a frame @ 2 second time-lapse. | |
Titanium Mobile | |
*/ | |
var movie = Titanium.Media.createVideoPlayer({ | |
contentURL:FILENAME, |
This file contains 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
* These are personal notes taken from various training events for debugging Windows 7 installation... | |
---------------- | |
1. Uninstall McAfee. Stop ALL McAfee services (services.msc) | |
2. Verify Internet access. | |
Add proxy for downloading (optional) | |
proxy.cognizant.com 6050 | |
3. Install Java JDK v1.6.x (1.7 is not supported) | |
4. Move Android SDK to |
This file contains 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
/* Roll your own reverse/forward geolocator | |
* | |
* YQL | |
*/ | |
Titanium.Yahoo.yql('select * from yahoo.maps.findLocation where q="'+latitude+','+longitude+'" and gflags="R"',function(e) { | |
var woeid = e.data.ResultSet.Results.woeid; | |
Titanium.API.info(woeid); | |
}); | |
/* |
This file contains 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
const int clockPin = 13; | |
const int dataPin = 11; | |
const int latchPin = 10; | |
byte arrow[8]={0x18,0x3C,0x66,0xDB,0x18,0x18,0x18,0x18}; | |
byte displayBuffer[8]= {0}; | |
int fontDefinitions[475] = { | |
0x00,0x00,0x00,0x00,0x00,/*space*/ // is 32 in ASCII | |
0x00,0xF6,0xF6,0x00,0x00,/*!*/ |
This file contains 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
- Add a Pre-Compile script in Xcode projects for all Titanium builds. This snippet will pre-compile Alloy projects in Xcode for faster debug workflows. | |
proj = injectCompileShellScript( | |
proj, | |
'Pre-Compile', | |
"alloy compile "+this.projectDir+"\n\n"+'if [ \\"x$TITANIUM_CLI_XCODEBUILD\\" == \\"x\\" ]; then NO_COLORS=\\"--no-colors\\"; else NO_COLORS=\\"\\"; fi\\n' + | |
(process.execPath || 'node') + ' \\"' + this.cli.argv.$0.replace(/^(.+\/)*node /, '') + '\\" build --platform ' + | |
this.platformName + ' --sdk ' + this.titaniumSdkVersion + ' --no-prompt --no-banner $NO_COLORS --xcode\\nexit $?' | |
); |
This file contains 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
-(id)suggestHeight:(id)arg | |
{ | |
CGFloat height = 0; | |
// resolve arg | |
if (arg != nil && [arg isKindOfClass:[NSArray class]]) | |
{ | |
NSArray *args = (NSArray *)arg; | |
if (args.count > 0) | |
arg = [args objectAtIndex:0]; |
This file contains 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
#!/bin/bash | |
free_data="$(free)" | |
mem_data="$(echo "$free_data" | grep 'Mem:')" | |
free_mem="$(echo "$mem_data" | awk '{print $4}')" | |
buffers="$(echo "$mem_data" | awk '{print $6}')" | |
cache="$(echo "$mem_data" | awk '{print $7}')" | |
total_free=$((free_mem + buffers + cache)) | |
used_swap="$(echo "$free_data" | grep 'Swap:' | awk '{print $3}')" |
This file contains 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
#!/usr/bin/env bash | |
. "$TM_SUPPORT_PATH/lib/webpreview.sh" | |
html_header "Javascript Runner" "Open Web Inspector for log" | |
YOURCODE=`cat` | |
cat <<HTML | |
<script> | |
(function(){try{ | |
This file contains 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 -y debhelper build-essential autotools-dev | |
curl -s -o /tmp/go.tar.gz https://go.googlecode.com/files/go1.1.1.linux-amd64.tar.gz | |
sudo tar -C /usr/local -xzf /tmp/go.tar.gz | |
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go |