Skip to content

Instantly share code, notes, and snippets.

_.resource('module');
_('#module-filter')
.keyup(function() {
_.('#module-list')
.resource_view({
filter: {
name: _(this).val()
}
});
// 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 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
#!/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
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
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
require 'redshift'
class RGraph
attr_accessor :meta, :canvas
def initialize config, json='"{}"'
@meta = Document['#meta']
@canvas = Document['canvas'].first
config.each do |key, value|
-require_css :master
=include_required_css
require 'redshift'
class JQuery < Array
def initialize selector
@els = Document[selector]
end
def each &block
@els.each &block
return this
,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);