This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This is an example of using RVM's Project .rvmrc file | |
| to have it automatically bootstrap your environment, including bundler. | |
| This could be further expanded to do anything you require :) | |
| The important thing to remember is that the purpose of these files is | |
| to allow you to very easily have your 'project context' (aka 'environment') | |
| loaded automatically for you when you enter the project in the shell (cd). | |
| You can generate the .rvmrc file below by running: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;(function($) { | |
| var app = $.sammy(function() { | |
| this.location_proxy = new Sammy.DataLocationProxy(this); | |
| this.get('#/', function() { | |
| $('#main').text(''); | |
| }); | |
| this.get('#/test', function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * An implementation of the K Combinator. | |
| * http://wiki.tcl.tk/1923 | |
| * | |
| * Copied from Mikael Brockman's code in Ruby on Rails' ActiveSupport library. | |
| * http://weblog.jamisbuck.org/2006/10/27/mining-activesupport-object-returning | |
| */ | |
| function returning(value, block, context) { | |
| block.call(context || null, value); | |
| return value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($){ | |
| $.each(["live", "die"], function( i, name ) { | |
| var method = $.fn[ name ]; | |
| $.fn[ name ] = function( types, data, fn, origSelector ) { | |
| if ( typeof types === "object" && !types.preventDefault ) { | |
| for ( var key in types ) { | |
| method.call( this, key, data, types[key], origSelector ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var CommentsController = $.sammy(function() { | |
| // CONFIG --------------------------------------------------------------- | |
| this.debug = true; | |
| this.use(Sammy.EJS); | |
| this.use(Sammy.NestedParams); | |
| this.element_selector = "#comments_app"; | |
| // this.location_proxy = new Sammy.DataLocationProxy(this); | |
| this.resources_loaded = false; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Comment = Model("comment", | |
| // Class methods | |
| { | |
| persistence: Model.RestPersistence("/posts/:post_id/comments"), | |
| findAllRemote: function(context, callback) { | |
| $.getJSON("/posts/" + context.post_id() + "/comments.json", function(json) { | |
| $.each(json, function(i, comment) { | |
| Comment.add(new Comment($.extend(comment, {post_id: context.post_id()}))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Some helper methods | |
| # | |
| app = | |
| activePage: -> | |
| $(".ui-page-active") | |
| reapplyStyles: (el) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone | |
| http://forum.jquery.com/topic/usability-touch-feedback-too-slow | |
| http://arandomurl.com/2011/03/16/coding-for-the-mobile-web.html | |
| http://floatlearning.com/2011/03/developing-better-phonegap-apps/ | |
| google fastbutton |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### GIT-PROMPT.SH CONFIG | |
| ### | |
| ### lines commented-out with single '#' are default values | |
| ### lines commented-out with double '##' are examples | |
| ### | |
| ### NOTE: this is bash syntax - no spaces around "=" | |
| ########################################################### |