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
--- a/app/views/layouts/_home_link.rhtml | |
+++ b/app/views/layouts/_home_link.rhtml | |
@@ -1,5 +1,5 @@ | |
<!-- ========= ITEM ========= --> | |
-<div class="item" onClick="document.location='<%= home_link[:url] %>'"> | |
+<div class="item" onClick="this.setAttribute('onclick', 'return false;'); document.location='<%= home_link[:url] %>'"> | |
<a href="<%= home_link[:url] %>"><div class="icon" | |
style="background-position: <%= home_link[:icon_pos][:x] %>px <%= home_link[:icon_pos][:y] %>px"> </div></a> | |
<div class="label"><a href="<%= home_link[:url] %>"><%= home_link[:label] %></a> | |
diff --git a/app/views/layouts/_nav_link.rhtml b/app/views/layouts/_nav_link.rhtml |
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 'benchmark' | |
class FizzBuzz | |
def fizz m | |
m % 5 == 0 ? "Fizz" : nil | |
end | |
def buzz n | |
n % 3 == 0 ? "Buzz" : nil | |
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
#!/usr/bin/env script/runner | |
# This file is used to import a dump of ODOC im | |
destinations = [] | |
Identity::Manuals.find_in_batches(:conditions => "what_system_did_i_come_from = 5") do |batch| | |
batch.each do |identity_manual| | |
destinations << [identity_manual.destination_id, identity_manual.facility_id] | |
identity_manual.delete | |
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
def crypt_unless_empty | |
if password.blank? | |
self.password = self.password_was | |
elsif ! nocrypt && self.password_changed? | |
write_attribute "password", self.class.sha1(password) | |
end | |
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
<script type="text/javascript"> | |
$(document).ready(function(){ | |
alert("<%=controller.controller_name%>") | |
}); | |
</script> |
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
Dungeon Crawl Stone Soup version 0.10.0 character file. | |
Erik the Acrobat (Kobold Berserker) Turns: 128024, Time: 07:15:29 | |
HP 179/179 AC 27 Str 26 XL: 27 | |
MP 22/22 EV 36 Int 11 God: Trog [******] | |
Gold 4424 SH 15 Dex 23 Spells: 0 memorised, 26 levels left | |
Res.Fire : + . . See Invis. : + a - +5,+9 quick blade {god gift} | |
Res.Cold : . . . Warding : . . X - +8 ring mail of Bumone {rElec} |
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
Dungeon Crawl Stone Soup version 0.10.0 character file. | |
Erik the Swashbuckler (Kobold Berserker) Turns: 79787, Time: 04:21:02 | |
HP 116/116 (120) AC 26 Str 26 XL: 19 Next: 53% | |
MP 18/18 EV 31 Int 12 God: Trog [*****.] | |
Gold 2391 SH 13 Dex 19 Spells: 0 memorised, 18 levels left | |
Res.Fire : + . . See Invis. : + a - +5,+9 quick blade {god gift} | |
Res.Cold : . . . Warding : . . X - +8 ring mail of Bumone {rElec} |
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
(╯°□°)╯︵ ┻━┻ |
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
def is_eager_loaded?(model, association) | |
!model.instance_variable_get("@#{association.to_s}").nil? | |
end | |
user = User.find(1, :include => :haunts) | |
is_eager_loaded?(user, :haunts) |
NewerOlder