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
| #!/usr/bin/env ruby | |
| require 'date' | |
| class Commit | |
| attr_reader :sha, :author, :date | |
| def initialize(attributes = {}) | |
| @sha = attributes[:sha] |
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
| <script src="http://code.jquery.com/jquery.min.js"></script> | |
| <script src="https://raw.github.com/olivernn/davis.js/modifier-keys/davis.js"></script> | |
| <a href="/foo">Foo</a> | |
| <a href="/bar">Bar</a> | |
| <script> | |
| Davis(function () { | |
| this.get('/foo', $.noop) | |
| this.get('/bar', $.noop) |
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
| window :editor do | |
| command "vim ." | |
| end | |
| window :shell | |
| window :console do | |
| command "irb" | |
| end |
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
| Davis.hash = function () { | |
| var handlers = [], | |
| lastPolledLocation | |
| var triggerHandlers = function (request) { | |
| Davis.utils.forEach(handlers, function (handler) { | |
| handler(request) | |
| }) | |
| } |
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
| name "rails" | |
| description "rails development environment" | |
| window "editor", selected: true do | |
| command "vim ." | |
| split :horizontal, height: 20 | |
| split :vertical do | |
| dir "~/code/hotrod" |
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
| Davis.extend(Davis.hashRouting({ forceHashRouting: true })) | |
| app = Davis(function () { | |
| this.settings.handleRouteNotFound = true | |
| this.get('#/foo', function () { | |
| console.log('foo') | |
| }) |
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 app = Davis(function () { | |
| this.configure(function () { | |
| this.linkSelector = 'nav a' | |
| this.formSelector = 'nav form' | |
| }) | |
| this.get('/', function (req) { | |
| showHomePage() | |
| }) |
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 app = Davis(function () { | |
| this.get('/foo', function () { | |
| alert('you clicked on foo!') | |
| }) | |
| }) |
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 cartApp = function () { | |
| this.scope('/cart', function () { | |
| this.post('/items', function (req) { | |
| // create an item | |
| }) | |
| this.del('/items/:id', function (req) { | |
| // delete a specific item from your cart | |
| }) |
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
| $.ajaxSetup({ | |
| beforeSend: function(xhr) { | |
| xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content')); | |
| } | |
| }); |