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
The Texas oilman T. Boone Pickens has now joined another high-profile McCain supporter, Arnold Schwarzenegger, in knocking the McCain nostrum that America can drill its way out of its energy crisis. Mr. Pickens, who financed the Swift-boat campaign smearing John Kerry in 2004, was thought to be a sugar daddy for similar assaults against the Democrats this year. Instead, he is underwriting nonpartisan ads promoting wind power and speaks of how he would welcome Al Gore as energy czar if there’s an Obama administration. |
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 'rubygems' | |
require 'httparty' | |
require 'digest' | |
USER = 'enter your username here' | |
PASS = 'Enter your password here' | |
SECRET = 'enter our secret here' | |
CLIENT = 'enter our inbox here' | |
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 self.today | |
day = Time.zone.parse(DateTime.now.to_date.to_s).utc | |
return Entry.find(:all, :conditions => ['created_at >= ? and created_at < ?', day, day + 86400]) | |
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 self.today | |
day = Time.zone.parse(DateTime.now.to_date.to_s).utc | |
return self.find(:all, :conditions => ['created_at >= ? and created_at < ?', day, day + 86400]) | |
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 self.on(dateterm) | |
day = Time.zone.parse(Chronic.parse(dateterm).to_date.to_s) | |
return [] if day.nil? | |
day = day.utc | |
return Entry.find(:all, :conditions => ['created_at >= ? and created_at < ?', day, day + 86400]) | |
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 self.on(dateterm) | |
day = Chronic.parse(dateterm) | |
return [] if day.nil? | |
day = Time.zone.parse(day.to_date.to_s).utc | |
return Entry.find(:all, :conditions => ['created_at >= ? and created_at < ?', day, day + 86400]) | |
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
named_scope :since, lambda { |dateterm| | |
day = Chronic.parse(dateterm, :context => :past) | |
day = Time.parse(dateterm) if day.nil? | |
raise "Could not parse date" if day.nil? | |
{ :conditions => ['created_at >= ?', Time.zone.parse(day.to_date.to_s).utc], :order => 'created_at asc' } | |
} | |
named_scope :on, lambda { |dateterm| | |
day = Chronic.parse(dateterm, :context => :past) | |
day = Time.parse(dateterm) if day.nil? |
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
//put this in subclass of NSTableView | |
//select the first row or blue highlights already selected rows | |
//in a NSTableView when we gain focus if there are rows in the table | |
-(BOOL) becomeFirstResponder { | |
if ([self numberOfRows] > 0 && [self numberOfSelectedRows] == 0) { | |
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; | |
} | |
[self setNeedsDisplay]; | |
return YES; |
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
//put this in subclass of NSTableView | |
- (void)keyDown:(NSEvent *)theEvent { | |
//if user tabs in this table, we don't want to edit (the default) | |
//instead select the next view | |
if ([theEvent keyCode] == 48) { | |
if ([[self window] firstResponder] == self) { | |
[[self window] selectNextKeyView:self]; | |
} | |
} else if ([theEvent keyCode] == 36){ | |
//the user pushed enter |
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.paths.unshift("/Users/johnw/js/node_modules") | |
require("./underscore") | |
sys: require("sys") | |
rest: require("restler") | |
rest.get('http://github.com/api/v2/json/repos/show/mrjjwright').addListener('complete', | |
((data) -> | |
repositories: JSON.parse(data).repositories | |
for repository in repositories |
OlderNewer