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 frax = function(context, next) { | |
if(!context.init) { | |
$.get(context.canonicalPath+'?_pjax=true', function(markup) { | |
if(context.delay) { | |
context.pending = markup; | |
}else { | |
context.container.html(markup); // cached $('#container') | |
} | |
next(); | |
}); |
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
class JourneyCoffeeGenerator < Journey::Visitors::Visitor | |
def accept node | |
@requirements = [[]] | |
super.gsub('" + "', '') | |
end | |
private | |
def visit_GROUP node | |
@requirements << [] |
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
class ApplicationController < ActionController::Base | |
before_filter :ensure_xhr | |
private | |
def ensure_xhr | |
if request.get? && request.format && (request.format.js? || request.format.json?) | |
head :forbidden unless request.xhr? | |
end | |
end | |
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
# config/routes.rb | |
resources :documents do | |
scope module: 'documents' do | |
resources :versions do | |
post :restore, on: :member | |
end | |
resource :lock | |
end | |
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
class HaveWant | |
attr_reader :answers | |
def initialize(*have, want) | |
@have = have[0] | |
@args = have[1..-1] | |
@want = want | |
find_matches |
OlderNewer