Skip to content

Instantly share code, notes, and snippets.

View mlynch's full-sized avatar
🍂
Building something new

Max Lynch mlynch

🍂
Building something new
View GitHub Profile
@mlynch
mlynch / app.js
Created June 13, 2012 22:38
Creating a new resource
initialize: function() {
this._fdb = new Firebase('http://gamma.firebase.com/opencountmadison/');
this._resources = this._fdb.child('resources');
this._bindEvents();
this._bindDataEvents();
},
// Bind interface events
_bindEvents: function() {
var self = this;
@mlynch
mlynch / widget.js
Created June 18, 2012 18:32
Widget Shell
(function($) {
$.widget('mobile.tabbar', $.mobile.navbar, {
}
})(jQuery);
@mlynch
mlynch / widget.js
Created June 18, 2012 18:38
Widget Shell
(function($) {
$.widget('mobile.tabbar', $.mobile.navbar, {
_create: function() {
$.mobile.navbar.prototype._create.call(this);
}
});
})(jQuery)
@mlynch
mlynch / widget.js
Created June 18, 2012 18:42
Page Create
(function($) {
$.widget('mobile.tabbar', $.mobile.navbar, {
_create: function() {
$.mobile.navbar.prototype._create.call(this);
// ...
}
});
$(document).bind('pagecreate create', function(e) {
(function($) {
$.widget('mobile.tabbar', $.mobile.navbar, {
_create: function() {
// Set the theme before we call the prototype, which will
// ensure buttonMarkup() correctly grabs the inheritied theme.
// We default to the "a" swatch if none is found
var theme = this.element.jqmData('theme') || "a";
this.element.addClass('ui-footer ui-footer-fixed ui-bar-' + theme);
// Call the NavBar _create prototype
$(":jqmData(role='page')").live('pageshow', function(e) {
// Grab the id of the page that's showing, and select it on the Tab Bar on the page
var tabBar, id = $(e.target).attr('id');
tabBar = $.mobile.activePage.find(':jqmData(role="tabbar")');
if(tabBar.length) {
tabBar.tabbar('setActive', id);
}
});
@mlynch
mlynch / main.py
Created July 20, 2012 19:54
BaseDriveHandler modifications
class BaseDriveHandler(w2.RequestHandler):
...
def StoreUserIdInSession(self, userid):
session = sessions.LilCookies(self, SESSION_SECRET)
session.set_secure_cookie(name='userid', value=userid)
def GetUserIdFromSession(self):
session = sessions.LilCookies(self, SESSION_SECRET)
@mlynch
mlynch / manifest.json
Created July 20, 2012 20:02
Codiqa Project Manifest
{
"name": "Codiqa Prototypes",
"description": "Rapid Mobile Prototyping - Saves directly to Google Drive!",
"version": "1.3",
"container": "GOOGLE_DRIVE",
"api_console_project_id" : "CONSOLE_PROJECT_ID",
"intents": {
"http://drive.google.com/intents/opendrivedoc": [ {
"disposition": "window",
"href": "http://codiqadrive.appspot.com",
localDrive.rm({
root: '/',
flags: 'rf'
});
localDrive.rm
root: '/'
flags: 'rf'