⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This spec describes a minimal stream interface meant for protocol implementors. Modules written to the interfaces in this spec can be used by a wide variety of projects. The protocols will not need any extra dependencies themselves. It's just an interface to implement.
A simple stream is just a function. It represents a pull-stream. It has the following signature:
// Implementing a stream.
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications
like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html
/* Kosso : March 12th 2011 | |
This the only way I managed to do this without the app crashing on resume. | |
Done slightly differently to the KS example, since they unregister the service and | |
do not use a setInterval timer. | |
*/ | |
//############ in app.js : | |
// test for iOS 4+ |
var win = Titanium.UI.createWindow({ | |
backgroundColor: 'blue' | |
}); | |
var btn = Ti.UI.createButton({ | |
title : 'Add Notification' | |
}); | |
btn.addEventListener('click', function(e) { | |
var activity = Ti.Android.currentActivity(); |
//////////////////////push_notifications.js/////////////////////// | |
var apns = function(){ | |
var pref = require('preferences').preferences; | |
Titanium.Network.registerForPushNotifications({ | |
types: [ | |
Titanium.Network.NOTIFICATION_TYPE_BADGE, | |
Titanium.Network.NOTIFICATION_TYPE_ALERT | |
], | |
success:function(e) |
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL | |
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew | |
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers | |
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it | |
gem install bundler | |
# 1. Get edge Rails source (master branch) | |
git clone https://github.com/rails/rails.git |
save_button.addEventListener('click', ()-> | |
if Ti.Filesystem.isExternalStoragePresent | |
save_image = Ti.Filesystem.getFile(path).read() | |
new_path = Titanium.Filesystem.externalStorageDirectory + Date.now().toString() + ".png" | |
f = Ti.Filesystem.getFile(new_path) | |
result = f.write(save_image) | |
unless result | |
return null |
function doClick(e) { | |
alert('Clicked!'); | |
} | |
// Remove the event listener like this: | |
// $.myWidget.off("click", doClick); | |
$.index.open(); |