start new:
tmux
start new with session name:
tmux new -s myname
| var win = Ti.UI.createWindow(); | |
| win.open(); | |
| /// <<< Register & UnRegister Event Listeners | |
| /** | |
| * params: {event: 'event', callback: eventCallback} | |
| */ | |
| function registerEventListener(obj, params) { | |
| if ( typeof obj._eventListeners == 'undefined' ) { |
| /** | |
| * Courtesy of Jeff Bonnes | |
| * http://www.titaniumdevelopment.com.au/blog/2011/09/12/debugging-ipad-performance-and-memory-usage/ | |
| */ | |
| /** | |
| * Modified to a commonJS format by Stephen Feather | |
| * Usage: | |
| * var Tracer = require('/lib/tracer'); |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
Tested against the WebKit git repo by entering the repo with 1 file dirty.
git diff --quiet --ignore-submodules HEAD # Will tell if there are any uncomitted changes, staged or not.
0.6 sec
git diff-index --quiet HEAD # Only tracked
2 sec
| { | |
| “status”: “success”, | |
| “images”: [ | |
| “http://lambdal.com/tiger.jpg” | |
| ], | |
| “photos”: [ | |
| { | |
| “url”: “http://lambdal.com/tiger.jpg”, | |
| “width”: 600, | |
| “tags”: [ |
| var rootWin = Ti.UI.createWindow(); | |
| var navGroup = Ti.UI.iPhone.createNavigationGroup({ | |
| window: rootWin | |
| }); | |
| var button = Ti.UI.createButton({ | |
| title: 'Open ListView Tests' | |
| }); | |
| button.addEventListener('click', function() { | |
| openTestsWindow(); | |
| }); |
I like easy drop-in CommonJS libraries that need minimal configuration to perform common tasks.
This CommonJS library checks with Apple every X days to see if there's a new version available. If so, it asks the user if he/she would like to update and then opens the app in the App Store.
At minimum, the library requires no configuration at all and just a single line of code.
Look at advanced.js for all available options and methods.
Also check out my rating library:
Often I need to display a user-provided picture in an ImageView in such a way that the whole ImageView is filled with as much of the picture possible.
This is how I do it:
var image = require('image');
Ti.Media.showCamera({
mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
success: function (e) {
| var btnCamera = Ti.UI.createButton({ | |
| title: 'Record', | |
| top: 500, | |
| left: 910, | |
| width: 100, | |
| height: 100, | |
| borderColor: "#FFF", | |
| borderRadius: 50, | |
| borderWidth: 3, | |
| backgroundImage: 'none', |