I hereby claim:
- I am mcurtis on github.
- I am mcurtis (https://keybase.io/mcurtis) on keybase.
- I have a public key whose fingerprint is 91AB EBC6 7A83 FEEC 6973 4731 8772 7F4F 0B91 06C8
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
def fetch_ftp | |
ftp = Net::FTP.new(self.meta[:host]) | |
ftp.login(user = self.username, passwd = self.password) | |
ftp.getbinaryfile(self.url, "dl-#{self.id}.txt") | |
ftp.quit() | |
output = MultiXml.parse(File.open("dl-#{self.id}.txt", "rb").read) rescue nil | |
File.delete("dl-#{self.id}.txt") | |
output | |
end |
<div id="the_div"> | |
<ul id="the_list"> | |
<li id="the_item">Click me!</li> | |
</ul> | |
</div> | |
<p id="log"></p> | |
<script type="text/javascript" charset="utf-8"> | |
function log(string){ |
// 1. Write a class to support the following code: | |
function Person(name) { | |
this.name = name; | |
} | |
var thomas = new Person('Thomas'); | |
var amy = new Person('Amy'); | |
thomas.name // --> "Thomas" |
Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '> '2010-01-31 02:01:26')) ORDER BY start ASC' at line 1: SELECT * FROM `meetings` WHERE ((`meetings`.user_id = 1) AND (meetings. > '2010-01-31 02:01:26')) ORDER BY start ASC |
def by_direction(condition, time, options = {}, &block) | |
field = 'end' | |
ensure_valid_options(options) | |
scoping = { :conditions => ["#{self.table_name}.#{field} #{condition} ?", time.utc] }.merge(options) | |
with_scope(:find => scoping) do | |
scoped_by(block) do | |
find(:all) | |
end | |
end | |
end |
class Meeting < ActiveRecord::Base | |
attr_accessible :title, :start, :start_date, :start_time, :duration, :external_id, :description | |
belongs_to :user | |
validates_presence_of :title | |
validates_numericality_of :duration, :greater_than_or_equal_to => 1 | |
before_save :calculate_end_time | |
def generate_external_id | |
record = Object.new | |
while record |
@meetings = current_user.meetings.future(Time.now, :field => :end) | |
Mysql::Error: Table 'meetings.end' doesn't exist: SELECT * FROM `meetings`.`end` WHERE ((`meetings`.user_id = 1) AND (`meetings`.`end` > '2010-01-31 01:12:09')) ORDER BY start ASC |
@meetings = Meeting.find(:all, :order => 'start ASC', :conditions => ['user_id = "?" AND end > ?',current_user.id,Time.now]) |