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
| module FacebookSession | |
| module Session | |
| def self.included(base) | |
| base.class_eval do | |
| cattr_accessor :finding_current | |
| include Methods | |
| end | |
| end | |
| module Methods |
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.Mutators.Memoize = function(method_names){ | |
| Array.from(method_names).each(function(method){ | |
| var old_method = this.prototype[method]; | |
| this.prototype[method] = function(){ | |
| if(this.__memoized[method] !== undefined) return this.__memoized[method]; | |
| return this.__memoized[method] = old_method.apply(this, arguments); | |
| }; | |
| }, this); | |
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 | |
| helper_method :page_title, | |
| :page_description | |
| # ... | |
| 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 EnumerableClass | |
| UNKNOWN_ENUMERABLE = "Unknown" | |
| class << self | |
| def all | |
| self.to_a.collect{|g| g[1]} | |
| end | |
| def add_item(key,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
| #attached_files | |
| %p.declaration | |
| Attachments: | |
| %em | |
| = add_object_link("add", "#attached_files", {:partial => '/attached_files/file', :locals => {:form => form}}) | |
| - object.attached_files.each_with_index do |attachment, i| | |
| = render :partial => '/attached_files/file', :locals => {:form => form, :attached_file => attachment, :child_index => i} |
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
| require 'exception_handler' | |
| class ApplicationController < ActionController::Base | |
| include YourApp::ExceptionHandler | |
| 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
| observe_anchors : function(){ | |
| box = this; | |
| $(document.body).addEvent('click:relay(a[rel*="box"])', function(e){ | |
| var a = e.target; | |
| if(a.rel && a.rel.test(box.opt.rel_target)){ | |
| box.set_loading(); | |
| box.construct_renderable_from_link(a).render(); | |
| e.stop(); | |
| } | |
| }); |
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 d = new Diabox({parser : function(target){ | |
| // use target string to determine the renderable key. ie 'custom_key' | |
| // return null if the target does not fit your criteria | |
| }}); |
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
| %title= meta(:title) | |
| %meta{:name => 'robots', :content => meta(:robots)} | |
| %meta{:name => 'description', :content => meta(:description)} |
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
| module TemplateHelper | |
| def url_for(*args) | |
| options = args.extract_options! | |
| return super unless options.present? | |
| handle = options.delete(:handlebars) | |
| url = super(*(args.push(options))) | |
| handle ? url.gsub(/%7B%7B(.+)%7D%7D/){|m| "{{#{$1}}}"} : url | |
| end |
OlderNewer