Skip to content

Instantly share code, notes, and snippets.

View danahern's full-sized avatar

Dan Ahern danahern

View GitHub Profile
module HomebrewEnvExtension
# -w: keep signal to noise high
SAFE_CFLAGS_FLAGS = "-w -pipe"
def setup_build_environment
# Clear CDPATH to avoid make issues that depend on changing directories
delete('CDPATH')
delete('CPPFLAGS')
delete('LDFLAGS')
# IRBRC file by Iain Hecker, http://iain.nl
# put all this in your ~/.irbrc
require 'rubygems'
require 'yaml'
alias q exit
class Object
def local_methods
(methods - Object.instance_methods).sort
/* @override
http://192.168.11.10:8000/stylesheets/main.new.css
http://192.168.11.11:3000/stylesheets/main.new.css
http://127.0.0.1:3000/stylesheets/main.new.css
*/
body {
margin: 0;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
<script type="text/javascript">
function displaycal<%= params[:passfield] %>()
{
var globalday = '';
var globalweek = '';
var globalcounter = '';
var globalrangecounter = 0;
var daterange1;
var daterange2;
var startdate = new Date();
mysql> explain select count(*), category_specific_fields.field_name, meta_fields.value from meta_fields LEFT JOIN category_specific_fields on meta_fields.category_specific_field_id = category_specific_fields.id LEFT JOIN categories on meta_fields.category_id = categories.id where categorizable_type = 'Listing' and categorizable_id in (SELECT distinct(`listings`.id) FROM `listings` where (expires_on IS NOT NULL)) and categories.lft BETWEEN 34204 and 35319 group by category_specific_fields.field_name, meta_fields.value;
+----+--------------------+--------------------------+-----------------+---------------------------------+---------+---------+----------------------------------------------------------------+--------+----------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra
module UpillarCategorization
def self.included(base)
base.extend ClassMethods
base.instance_eval do
belongs_to :seller, :polymorphic => true
include InstanceMethods
end
end
module ClassMethods
offset = 0
time_started = Time.now
while !(listings = Listing.find(:all, :conditions => ["dealership_reference_number is not null and dealership_id is not null and created_on < ?", '2009-02-01'], :limit => 1000, :offset => offset*1000)).blank? do
time_elapsed = Time.now-time_started
puts offset.to_s+": "+time_elapsed.to_s
offset += 1
time_started = Time.now
end
1 2 3 4 5 6 7
( 0.069718) ( 0.246261) ( 0.763173) ( 1.081057) ( 1.574744) ( 1.764654) ( 5.048611)
( 0.062034) ( 0.334867) ( 0.783565) ( 1.088744) ( 1.369428) ( 1.804560) ( 5.307273)
( 0.061823) ( 0.280887) ( 0.805867) ( 1.196155) ( 1.522185) ( 1.819005) ( 5.335199)
( 0.063819) ( 0.237121) ( 0.785245) ( 1.142058) ( 1.574173) ( 1.831318) ( 7.042763)
( 0.064455) ( 0.366056) ( 0.793258) ( 1.257599) ( 1.582396) ( 2.012746) ( 5.352294)
( 0.058928) ( 0.230666) ( 0.644446) ( 1.080747) ( 1.524916) ( 1.789132) ( 5.020250)
( 0.162462) ( 0.227316) ( 0.764695) ( 1.086052) ( 1.534200) ( 1.756733) ( 4.963422)
( 0.062698) ( 0.228166) ( 0.767579) ( 1.223117) ( 1.553063) ( 1.758404) ( 4.969319)
( 0.060097) ( 0.355434) ( 0.784113) ( 1.080691) ( 1.556533) ( 1.779492) ( 5.002753)
> news = New.new
=> #<New:0x2228038 @attributes={"pillar_type_id"=>nil, "created_on"=>nil, "title"=>nil, "updated_on"=>nil, "content"=>nil, "user_id"=>nil, "image"=>nil}, @new_record=true>
>> news.title = 'test'
=> "test"
>> news.content = 'test'
=> "test"
>> news.id = 500
=> 500
>> news
=> #<New:0x2228038 @attributes={"pillar_type_id"=>nil, "created_on"=>nil, "title"=>"test", "updated_on"=>nil, "id"=>500, "content"=>"test", "user_id"=>nil, "image"=>nil}, @new_record=true>
ActionView::TemplateError occurred in credit_cards#confirmation_page:
"Expected /usr/motors/app/models/credit_card.rb to define CreditCard"
On line #62 of app/views/notifier/purchase_conf_en.rhtml
59: <td align='left' colspan='2'>
60: <hr/>
61: </td>
62: </tr><% unless @purchase_log.credit_card.blank? %>
63: <tr>