This file contains 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
/* | |
$listvar: | |
"appname1" "blue", | |
"appname2" "red" | |
; | |
.my-selector { | |
@include tenant($listvar) { | |
background-color: $var; |
This file contains 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
Show hidden characters
{ | |
// JSHint Default Configuration File (as on JSHint website) | |
// See http://jshint.com/docs/ for more details | |
"maxerr" : 50, // {int} Maximum error before stopping | |
// Enforcing | |
"bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.) | |
"camelcase" : false, // true: Identifiers must be in camelCase | |
"curly" : false, // true: Require {} for every new block or scope |
This file contains 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 A = pie.base.extend({ | |
init: function(){ | |
console.log('A'); | |
this._super(); | |
} | |
}); | |
var B = A.extend({ | |
init: function() { | |
this._super(); |
This file contains 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 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 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 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 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 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 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(); | |
} | |
}); |
OlderNewer