Skip to content

Instantly share code, notes, and snippets.

@trabianmatt
trabianmatt / 1_index.coffee
Last active December 11, 2015 03:39
A preview of what's in store for titanium-backbone. (Ignore the numbers and underscores in the file names - they are intended only to provide order to the gists).
SampleWindow = require './window'
person = new Backbone.Model
name: 'John Doe'
sampleWindow = new SampleWindow
model: person
sampleWindow.render().open()
@trabianmatt
trabianmatt / template.jade
Created January 15, 2013 15:20
Sample template
Label= title
View(layout='horizontal', top=11)
Button.clickable I work!
Button.notclickable I don't!
@trabianmatt
trabianmatt / sample_view.coffee
Last active December 11, 2015 03:39
sample titanium-backbone view
template = require './template'
module.exports = class Window extends Backbone.View
viewName: 'Window'
attributes:
backgroundColor: '#eee'
layout: 'vertical'
@trabianmatt
trabianmatt / restart_passenger.py
Created January 8, 2013 01:56
Restart passenger
import sublime, sublime_plugin
import os, time
class RestartPassengerCommand(sublime_plugin.TextCommand):
"""Touch tmp/restart.txt file in the rails project to restart pasenger"""
def run(self, edit):
for folder in self.view.window().folders():
fname = os.path.join(str(folder), 'tmp', 'restart.txt')
if os.path.exists(os.path.dirname(fname)):
@trabianmatt
trabianmatt / titanium-backbone-api-example.coffee
Created January 4, 2013 16:14
Example usage of titanium-backbone
# Default Titanium API
button = Ti.UI.createButton
title: 'Testing'
button.addEventListener 'click', ->
alert 'Click!'
return
@view.add button
@trabianmatt
trabianmatt / delegated_event_example.coffee
Last active December 10, 2015 13:49
Example delegated event
class ExtendedView extends View
clicked: false
events:
'click #someChild': 'clickMethod'
render: =>
Backbone.$('<View>')
@trabianmatt
trabianmatt / packages.txt
Created July 2, 2012 05:10
Matt's packages installed so far
* Case Conversion
* Backbone - Trabian (custom plugin)
* ChangeQuotes
* CoffeeScript
* CTags (with coffeescript ctags)
* Git
* GitHubinator
* Guard (prevents need to keep a separate terminal open for running guard)
* Jade
* Origami
styles = require('styles').ui
{ Button, ContentBlock, Window } = require 'views/ui'
module.exports = class IntroView extends Window
render: =>
@layout (view) =>
styles = require('styles').ui
{ Button, Window } = require 'views/ui'
module.exports = class IntroView extends Window
render: =>
@layout (view) =>
styles = require('styles').ui
KitchenSink = require './main'
{ Button, Window } = require 'views/ui'
module.exports = class IntroView extends Window
render: =>