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
# Add fixture-generation methods to ControllerExampleGroup. We load | |
# this file within our spec_helper.rb | |
Spec::Rails::Example::ControllerExampleGroup.class_eval do | |
# Saves the markup to a fixture file using the given name | |
def save_fixture(markup, name) | |
fixture_path = File.join(RAILS_ROOT, '/tmp/js_dom_fixtures') | |
Dir.mkdir(fixture_path) unless File.exists?(fixture_path) |
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
// Loads fixure markup into the DOM as a child of the jasmine_content div | |
spec.loadFixture = function(fixtureName) { | |
var $destination = $('#jasmine_content'); | |
// get the markup, inject it into the dom | |
$destination.html(spec.fixtureHtml(fixtureName)); | |
// keep track of fixture count to fail specs that | |
// call loadFixture() more than once | |
spec.loadFixtureCount++; |
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
$(function() { | |
$("head").append("<sc" + "ript src='" + ((document.location.protocol=="https:")?"https:":"http:") + "//snapabug.appspot.com/snapabug.js" + "' type='text/javascript'></sc" + "ript>"); | |
(function() { | |
var snapABugLoader = setInterval(function() { | |
if (typeof SnapABug != "undefined") { | |
SnapABug.setButton("https://snapabug.appspot.com/statusImage?w=OUR KEY",35,90); | |
SnapABug.addButton('OUR KEY',"1","400px"); | |
SnapABug.setButtonEffect('-4px'); | |
clearInterval(snapABugLoader); |
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
#!/bin/sh | |
grep -R .find_by . | ruby -e 'STDIN.each do |l| puts "#{$1} #{$2}" if l =~ /([_\w]+)\.find_by_([_\w]+)/ && !%w[class self].include?($1) && !%w[solr sql id param].include?($2); end' | sort | uniq -c |
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
function refreshBackgrounds(selector) { | |
// Chrome shim to fix http://groups.google.com/a/chromium.org/group/chromium-bugs/browse_thread/thread/1b6a86d6d4cb8b04/739e937fa945a921 | |
// Remove this once Chrome fixes its bug. | |
if (/chrome/.test(navigator.userAgent.toLowerCase())) { | |
$(selector).each(function() { | |
var $this = $(this); | |
if ($this.css("background-image")) { | |
var oldBackgroundImage = $this.css("background-image"); | |
setTimeout(function() { | |
$this.css("background-image", oldBackgroundImage); |