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
_.resource('module'); | |
_('#module-filter') | |
.keyup(function() { | |
_.('#module-list') | |
.resource_view({ | |
filter: { | |
name: _(this).val() | |
} | |
}); |
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
// When hovering over an anchor | |
// find all anchors with the same href attribute | |
// and give them all a 'hover' class | |
;(function(_){ | |
jQuery.fn.extend({ | |
attrSelector: function(attr) { | |
return '[' | |
+ attr | |
+ '="' |
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 a really crappy way to do job runners. | |
#But I'd never used a job queue before, so I | |
#wanted to do it at least once the wrong way | |
#to figure it out. | |
require 'colored' | |
class Job | |
include DataMapper::Resource | |
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/ruby | |
# Copyright (c) 2004 - 2008 Beanlogic Limited | |
# | |
# This file is part of gedit_on_rails. | |
# You should have received a copy of the GNU General Public License | |
# along with gedit_on_rails. If not, see <http://www.gnu.org/licenses/>. | |
GEDIT = `which gedit`.chomp | |
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
def define_link_renderer association_type=nil, &block | |
@link_renderer= LegacyPaginationLinkRenderer.new(if block_given? | |
block | |
else | |
lambda { |params| | |
url(association_type, :page => params[:page]) | |
} | |
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
Merb::BootLoader.after_app_loads do | |
require 'red' | |
require 'merb_red' | |
# Update on every request in development mode | |
# But only on app load for production | |
Red::MerbPlugin.ensure_installation! | |
if Merb.env == 'development' | |
Merb.logger.info "Hooking Red Into Request" | |
# I'm looking at how the sass/plugin does re-generating on every 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
require 'redshift' | |
class RGraph | |
attr_accessor :meta, :canvas | |
def initialize config, json='"{}"' | |
@meta = Document['#meta'] | |
@canvas = Document['canvas'].first | |
config.each do |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
-require_css :master | |
=include_required_css |
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 'redshift' | |
class JQuery < Array | |
def initialize selector | |
@els = Document[selector] | |
end | |
def each &block | |
@els.each &block | |
return 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
,sortable: function(action, options) { | |
if(action == 'enable') { | |
console.log(this) | |
return this | |
.data('sortable', true) | |
.bind('dragstart.sortable', function() { | |
var _this = _(this); | |
var blank = _this.clone().css('visibility', 'hidden'); | |
_this.before(blank); | |
_this.data('blank', blank); |