If you have a CommonJS module that exposes properties that are expensive to create (e.g. other CommonJS modules or some external resource), you can load them lazy using Object.defineProperty()
.
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
<?php | |
function foobarbaz(){ | |
// Extract environment object to local scope (not mandatory, you can access the parent scope via $this. Ex. $this->foo ) | |
extract((array)$this); | |
var_dump($foo, $bar, $baz); | |
} | |
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
# Titanium aliases | |
alias ti-is-dev="if [ -e devtiapp.xml ]; then cp tiapp.xml tiapp.xml.copy; rm tiapp.xml; ln -svf devtiapp.xml tiapp.xml; fi" | |
alias ti-is-prod="if [ -e prodtiapp.xml ]; then cp tiapp.xml tiapp.xml.copy; rm tiapp.xml; ln -svf prodtiapp.xml tiapp.xml; fi" | |
# iOS | |
alias ti-ios="ti-is-dev && ti build -p ios --sim-64bit -I 7.1" | |
alias ti-ios-device="ti-is-dev && ti build -p ios -T device -I 7.1 --device-id all" | |
alias ti-ios-test="ti-is-dev && ti clean && ti build -p ios -T dist-adhoc -I 7.1" | |
alias ti-ios-install="ideviceinstaller --install dist/*.ipa" | |
# Android | |
alias ti-android="ti-is-dev && ti build -p android" |
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
-(void)setShadow_:(id)args | |
{ | |
if(args != nil) | |
{ | |
self.layer.masksToBounds = NO; | |
if ([args objectForKey:@"shadowOffset"] != nil) { | |
CGPoint p = [TiUtils pointValue: [args objectForKey:@"shadowOffset"]]; | |
CGSize shadowOffset = {p.x,p.y}; |
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
/*! Socket.IO.js build:0.9.6, development. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed */ | |
/** | |
* Originally Ported to titanium by Jordi Domenech <jordi@iamyellow.net> | |
* source: https://github.com/iamyellow/socket.io-client | |
*/ | |
this.io = {}; | |
module.exports = this.io; | |
/** |
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
@import UIKit; | |
@import AVFoundation; | |
@class _UISiriWaveyView; | |
@protocol _UISiriWaveyViewDelegate <NSObject> | |
- (CGFloat)audioLevelForWaveyView:(_UISiriWaveyView *)waveyView; | |
@end | |
typedef NS_ENUM(NSInteger, _UISiriWaveyViewMode) { |
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
if (Ti.Network.remoteNotificationsEnabled) { | |
Ti.API.info('User has enabled push'); | |
} else if (Ti.Network.remoteDeviceUUID === null) { | |
Ti.API.info('User has never enabled push'); | |
} else { | |
Ti.API.info('User has manually disabled push'); | |
} |
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
function days360(initialDate, currentDate) { | |
var dateA = initialDate; | |
var dateB = currentDate; | |
var dayA = dateA.getDate(); | |
var dayB = dateB.getDate(); |
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
/** | |
* Appcelerator Titanium Mobile | |
* Copyright (c) 2009-2016 by Appcelerator, Inc. All Rights Reserved. | |
* Licensed under the terms of the Apache Public License | |
* Please see the LICENSE included with this distribution for details. | |
* | |
* WARNING: This is generated code. Modify at your own risk and without support. | |
*/ | |
#ifdef USE_TI_UIWINDOW |
OlderNewer