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
var win = Ti.UI.createWindow({ | |
backgroundColor: '#333' | |
}); | |
var box = Ti.UI.createView({ | |
backgroundColor:'blue', | |
center:{x:50,y:50}, | |
height:40, | |
width:40 | |
}); |
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
//This is a demo to show how backgroundLeftCap and backgroundTopCap work on the Tianium platform by Appcelerator | |
//Paste this code in app.js (tested on iOS) | |
//Screenshot: http://screencast.com/t/txWQD3l2UBN | |
/////////////////////////////////////////////////////////////////////////////// | |
//Just modify these variables to see how backgroundLeftCap and topCap will work | |
var topCap = 20; | |
var leftCap = 35; | |
var originalImageSize = {height:100, width:100} |
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 uploadPhoto( _source, _callback) { | |
var onSuccess = function(e){ | |
if(e.media){ | |
Cloud.Photos.create({ | |
photo: e.media | |
}, function (e) { | |
if (e.success) { | |
var photo = e.photos[0]; | |
alert('Success:\\n' + |
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
<Alloy> | |
<Window class="container" onOpen="App.loader"> | |
<Button onClick="showAlertDialog">Alert</Button> | |
<AlertDialog id="alertDialog" title="title" message="This is my message" cancel="1"> | |
<ButtonNames> | |
<ButtonName>OK</ButtonName> | |
<ButtonName>Cancel</ButtonName> | |
<ButtonName platform="android">android</ButtonName> | |
</ButtonNames> | |
</AlertDialog> |
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
/* | |
Caching remote images | |
As you know, you can display local and remote images in a Titanium ImageView. | |
When loading remote images, you should set the defaultImage property to local image, | |
which will be displayed while the remote image is being downloaded. | |
Furthermore, you should cache remote images that will be frequently accessed for two reasons: | |
first so that subsequent uses of your app will load those images more quickly, | |
and second, so that the images aren't re-downloaded consuming users' data quotas unnecessarily. |
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 | |
/** | |
* Bootstrap | |
* @author Aleksandr Torosh <[email protected]> | |
* https://github.com/oleksandr-torosh/phalcon-modular-app/blob/master/app/Bootstrap.php | |
*/ | |
class Bootstrap | |
{ |
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 | |
/* /app/widgets/Slider.php */ | |
namespace Widgets; | |
use Widget; | |
// Наш новый виджет слайдера | |
class Slider extends Widget |
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 | |
/** | |
* Определение наличия мата (нецензурных слов) в тексте, матотест | |
* | |
* Алгоритм достаточно надёжен и быстр, в т.ч. на больших объёмах данных | |
* Метод обнаружения мата основывается на корнях и предлогах русского языка, а не на словаре | |
* Слова "лох", "хер", "залупа", "сука" матерными словами не считаются (см. словарь Даля) | |
* Разработка ведётся с 2005 года | |
* | |
* Класс явл. хорошим учебным пособием по изучению регулярных выражений и... русского мата! =) |
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
/** | |
* @return mixed or false | |
*/ | |
function array_find($array, $fn) { | |
$next = current($array); | |
while ($next) { | |
$key = key($array); | |
if (call_user_func_array($fn, [$next, $key])) { | |
return $next; | |
} |
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 | |
class Url extends \Phalcon\Mvc\Url | |
{ | |
/** | |
* Generates a URL with GET params | |
* | |
* <code> | |
* |
OlderNewer