Skip to content

Instantly share code, notes, and snippets.

View euforic's full-sized avatar

Christian Sullivan euforic

View GitHub Profile
@euforic
euforic / script.js
Created October 29, 2011 06:52
tublr page as home page hack
if(location.pathname.slice(1) == "" && location.hash !== '#blog') {
location.href='http://mysite.tumblr.com/home'
}
@euforic
euforic / app.js
Created April 24, 2012 23:31
Easy Evented Titanium Forms With Shimmy
//Requires [Shimmy](https://github.com/Xogix/TiLibrary/tree/master/Shimmy)
//Simple forms with Shimmy
var shimmy = require('/Shimmy')
, ui = shimmy.UI
, _ = shimmy._;
var win = ui.Window();
var form = ui.Form({
@euforic
euforic / app.js
Created May 11, 2012 04:35
Quick dirty hack for Node.js like modules with package.json and node_module directory for Titanium
require('require_patch')(this);
/**
* Loads "myModule" from your applications "Resources/titan_modules" directory if package.json is present.
* If "main" is set in package.json module will be loaded from that file else defaults to "index.js"
*/
var myModule = require('myModule');
myModule.someFunction();
@euforic
euforic / ti.socket.io.js
Created June 5, 2012 17:02
Socket.io-client Titanium
/*! 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;
/**
@euforic
euforic / app.js
Created June 13, 2012 21:48
Chatty Logger
var logger = require('lib/socket.io-client').connect({id:'MyAppName', channel:'MyAppChannel'});
var window = Ti.UI.Window();
window.open();
var jsonTest = {'test':'testparam'};
//String Example
logger.log('test message');
@euforic
euforic / jsdev.md
Created August 22, 2012 21:03
JS DEV REQUIREMENTS

Calling All Javascript Geeks

If you’ve got experience with building apps with node.js, Titanium and Javascript, integration with web systems via REST or other methods, you don’t mind working in a team, you aren’t afraid to ask for help when you need it, you’re social, you’re willing to go the extra mile to get the job done, your're a quick learner and know how solve and execute problem solutions.

We are a Mac shop, who is Windows friendly so long as you don’t mind converting.

The critical bits:

  • You have a github account and actually use it.
  • iOS and/or Android using Titanium and/or ObjC (willing to learn the other if you only know Javascript)
@euforic
euforic / apibuilder.js
Created September 18, 2012 04:02
API Builder
/*!
* apibuilder
* Copyright (c) 2012 Christian Sullivan <cs@euforic.co>
* MIT Licensed
*/
var request = require('superagent');
/**
* Module Exports
@euforic
euforic / view.js
Created October 22, 2012 06:10
MVC Breakout - VIEW
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// Module Exports
var self = module.export = {};
// create tab group
self.tabGroup = Titanium.UI.createTabGroup();
/File generated Using psd2ti
var self = Ti.UI.createWindow();
self.open();
var bg = Ti.UI.createImageView({
top: 0, left: 0,
height: 480, width:320,
backgroundImage: 'images/bg.png'
@euforic
euforic / git-ticket
Created December 4, 2012 01:26
Jira Ticket Git Shortcut Command
if test "$1" = "finish"; then
test -z $2 && echo "ticket <name> number." 1>&2 && exit 1
branch=timob-$2
git checkout master
git branch -D $branch && git push origin :$branch
else
test -z $1 && echo "ticket <name> required." && exit 1
branch=timob-$1
git checkout -b $branch &> /dev/null
git checkout $branch &> /dev/null