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
/* | |
* Titanium mobile jsondb module sample | |
*/ | |
Ti.API.info(Ti.Utils.sha1('testing')); | |
Ti.API.info(Ti.Filesystem.applicationDataDirectory); | |
var jsondb = require('com.irlgaming.jsondb'); | |
var collection = jsondb.factory('objects', 'mysharedsecret'); | |
collection.save({ hoge: 'fuga' }); |
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.UI.setBackgroundColor('#fff'); | |
var window = Ti.UI.createWindow({ | |
navBarHidden: true | |
}); | |
var assistiveTouch = require('ti.draggable').createView({ | |
top: 0, | |
left: 0, | |
width: 48, |
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
filterablecamera = require('filterablecamera').Filterablecamera({ | |
squared: true, | |
showControls: true, | |
animated: false, | |
autohide: true, | |
saveToPhotoGallery: true, | |
quality: 'Photo', | |
backgroundImage: 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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express'), | |
io = require('socket.io'), | |
routes = require('./routes'), | |
fs = require('fs'), | |
path = require('path') | |
; |
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
task("pre:compile", function(event,logger) { | |
var wrench = require("wrench"), | |
fs = require("fs"), | |
path = require("path"), | |
coffee = require("coffee-script"); | |
event.alloyConfig.coffee = []; | |
wrench.readdirSyncRecursive(event.dir.home).forEach(function(target){ | |
if (target.match(/\.coffee$/)) { |
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
task("pre:compile", function(event,logger){ | |
}); | |
task("post:compile",function(event,logger){ | |
var fs = require("fs"); | |
fs.writeFileSync(event.dir.resourcesAlloy + '/underscore.js', fs.readFileSync('path/to/underscore.js', 'utf8')); | |
var backbone = fs.readFileSync('path/to/backbone.js').toString(); | |
fs.writeFileSync(event.dir.resourcesAlloy + '/backbone.js', backbone.replace(/require\("underscore"\)/, 'require("alloy/underscore")')); |
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
... | |
Alloy.Globals.CSS = function(view, name){ | |
var css = require('css/css'); | |
view.applyProperties(css[name]); | |
}; |
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
task("pre:compile", function(event,logger) { | |
logger.info('----- PRE:COMPILE -----'); | |
}); | |
task("post:compile",function(event,logger){ | |
logger.info('----- POST:COMPILE -----'); | |
var fs = require('fs'), | |
path = require('path'), | |
platform = event.alloyConfig.platform === 'ios' ? 'iphone' : event.alloyConfig.platform; // Resources/iphone |
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
exports.definition = { | |
config: { | |
'columns': { | |
'bar': 'text' | |
}, | |
'adapter': { | |
'type': 'sql', | |
'collection_name': 'foo' | |
} | |
}, |
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
// http://stackoverflow.com/questions/3912532/ios-how-can-i-receive-http-401-instead-of-1012-nsurlerrorusercancelledauthenti | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation" | |
-(NSNumber*)status | |
{ | |
NSString *strError = [NSString stringWithFormat:@"%@", [[[self response] error] description]]; | |
if ([strError rangeOfString:@"Code=-1012"].location != NSNotFound) | |
{ | |
return NUMINTEGER(401); | |
} |
OlderNewer