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 Foo < ActiveRecord::Base | |
has_many :bars, :conditions => ["bars.source = ?", source] | |
... | |
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
I'm using Nokogiri 1.3.3 for the following code snippet. When I try using 1.4, it takes very long to load the 250mb xml file and I run out of memory before it | |
finishes. Using 1.4, the process takes up 2.5gb+ of memory before it fails from out of memory errors. Using 1.3.3, the process takes up about 1gb of memory after | |
loading the XML file. It appears the xpath method fails on large files with a large number of nodes. The single_property.xml contains only the | |
first <Property> node and its child nodes found in the properties.xml. | |
doc = Nokogiri::XML(File.open("db/properties.xml")) | |
doc2 = Nokogiri::XML(File.open("db/single_property.xml")) | |
>> doc.xpath("//Property").size | |
=> 0 |
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
@echo off | |
setlocal | |
set PATH=C:\Program Files\Git\bin;%PATH% | |
setlocal | |
set HOME=C:\Documents and Settings\Administrator | |
git pull origin master | |
-------------------------------------------------------- | |
I'm trying to run the .bat script above using ASP.NET. When I output the errors, I get: |
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
// Referenced from https://developer.mozilla.org/en/DOM/document.createEvent | |
var simulateClick = function (el) { | |
var evt = document.createEvent("MouseEvents"); | |
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
el[0].dispatchEvent(evt); | |
} | |
simulateClick($('#somelink')); |
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
checking ImageMagick MagickWand API configuration program... found in /Users/{user}/ImageMagick-6.5.3//bin/MagickWand-config | |
checking if ImageMagick version is at least 6.2.4... found version 6.5.3 Q16 | |
checking for MagickWand.h header file... configure: error: Cannot locate header file MagickWand.h |
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 Event < ActiveRecord::Base | |
belongs_to :creator, :class_name => 'Profile' | |
def pending_invites(emails) | |
c = self.creator | |
emails.each do |email| | |
p = Profile.find_by_email(email) | |
unless p.blank? | |
c.sent_messages.create( | |
:receiver => p, |
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
# From http://github.com/jaymcgavren | |
# modified by http://twitter.com/jonhinson to include Test::Unit cases | |
# Save this as rcov.rake in lib/tasks and use rcov:all => | |
# to get accurate spec/feature coverage data | |
require 'cucumber/rake/task' | |
require 'spec/rake/spectask' | |
require 'rcov/rcovtask' | |
namespace :rcov do |
NewerOlder