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
- no_sections ||= false | |
- callback ||= false | |
.modal.fade{:id => modal_id} | |
- if no_sections | |
= yield | |
- else | |
.modal-header | |
%a{:href => '#', :class => 'close', 'data-dismiss' => 'modal'}x | |
- if content_for?(:modal_header) |
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
Event.observe(window, 'load', function() { | |
var img = $$('.property-picture img').first(); | |
if(img){ | |
img.src = "http://assets.moveglobally.com/organization_files/3867/Solares_001.jpg"; | |
img.setStyle({ | |
width: '820px', | |
height: 'auto' | |
}); | |
img.up('.property-picture').setStyle({ | |
width: 'auto', |
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
Actor.count | |
Movie.count | |
Movie[0] | |
Movie[422] | |
Movie[100..110] |
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
# ActiveRecord | |
# post.rb | |
class Post < ActiveRecord::Base | |
end | |
# 20110813001308_create_posts.rb | |
class CreatePosts < ActiveRecord::Migration | |
def self.up |
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
(cat <<EOCAT | |
Subject: HTML Email | |
MIME-Version: 1.0 | |
Content-Type: text/html | |
Content-Disposition: inline | |
EOCAT | |
cat txt_file) | sendmail user@email.com |
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
#!/usr/bin/env ruby | |
# put in /etc/munin/plugins and restart munin-node | |
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin | |
# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats | |
def output_config | |
puts <<-END | |
graph_category App | |
graph_title Passenger memory stats | |
graph_vlabel count |
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 BaseClass | |
@@var = "BaseValue" | |
def var | |
@@var | |
end | |
end | |
class SubClass < BaseClass | |
@@var = "OverriddenValue" |
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 AutoGrowTextArea = Class.create({ | |
initialize: function(textarea){ | |
this.textarea = textarea; | |
this.line_height = parseInt(textarea.getStyle('lineHeight')) || 15; | |
this.max_height = parseInt(textarea.getStyle('maxHeight')) || 600; | |
this.min_height = parseInt(textarea.getStyle('minHeight')) || 100; | |
// set default style | |
this.textarea.setStyle({ |