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 market_id_unique_to_plan? | |
accum = 0 | |
plan.get_plan_market_ids.each do |current_market_id| | |
accum += 1 if current_market_id.sort == self.market_id.sort | |
end | |
accum < 2 ? true : false | |
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
$(document).ready(function() { | |
$("table").tablesorter({ | |
headers: { | |
2: { | |
sorter: 'digit' | |
} | |
}, | |
debug: true | |
}); | |
}); |
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
actionmailer (2.3.2, 1.3.6) | |
actionpack (2.3.2, 1.13.6) | |
actionwebservice (1.2.6) | |
activerecord (2.3.2, 1.15.6) | |
activeresource (2.3.2) | |
activesupport (2.3.2, 1.4.4) | |
acts_as_ferret (0.4.4, 0.4.1) | |
addressable (2.1.0, 2.0.2) | |
capistrano (2.5.8, 2.0.0) | |
cgi_multipart_eof_fix (2.5.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
1c1,2 | |
< AIUCEC001:17452:0 | |
--- | |
> ACP011:18194:15 | |
> ACP011:18562:16 | |
9c10,11 | |
< ALLSTATENEYCA002:18043:0 | |
--- | |
> ALLSTATENEYCA002:18446:1 | |
> ALLSTATENEYCA003:18124: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
/* This is when a refactoring really pays off. | |
* | |
* In order to make your code more modular, avoid hard-coding assumptions (or refactor them away). | |
* The most fundamental, anti-modular assumption in Object-Oriented software is the concrete type of objects. | |
* Any time you write "new MyClass" in your code (or in Ruby MyClass.new) you've hardcoded | |
* an assumption about the concrete class of the object you're allocating. These makes it impossible, for example, | |
* for someone to later add logging around method invocations of that object, or timeouts, or whatever. | |
* | |
* In a very dynamic language like Ruby, open classes and method aliasing mitigate this problem, but | |
* they don't solve it. If you manipulate a class to add logging, all instances of that class will have |
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
"An article on Tuesday about Twitter’s plan to make money from advertising | |
omitted the name of one of its co-founders. In addition to Evan Williams and | |
Biz Stone, who continue to work at the company, Jack Dorsey was a co-founder | |
and remains as nonexecutive chairman." | |
The New York Times. | |
<http://www.nytimes.com/2010/04/13/technology/internet/13twitter.html> | |
And who is that 'easy to forget that he was a cofounder at twitter'? The guy | |
with the idea. when ev was stilling pushing odeo. |
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 'sinatra' | |
require 'redis' | |
# To use, simply start your Redis server and boot this | |
# example app with: | |
# ruby example_note_keeping_app.rb | |
# | |
# Point your browser to http://localhost:4567 and enjoy! | |
# |
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 bb2a78858cffa7c6937642986e9aca1a4f862c0d Mon Sep 17 00:00:00 2001 | |
From: Ilya Grigorik <[email protected]> | |
Date: Thu, 10 Jun 2010 00:46:48 -0400 | |
Subject: [PATCH] async rails3 | |
--- | |
Gemfile | 6 ++++++ | |
app/controllers/widgets_controller.rb | 6 ++++++ | |
app/models/widget.rb | 2 ++ | |
config.ru | 1 + |
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
# estimate the duration of an ALTER TABLE statement in mysql | |
# this code estimates the worst case, as most of the time, an ALTER will result in a table that is smaller than the original | |
percentage = 0 | |
interval = 10 | |
while(true) do | |
sleep(interval) | |
new_percentage = (File.size('#sql-5316_1a.ibd')*1.0 / File.size('moves.ibd')*1.0) | |
change = new_percentage - percentage | |
intervals = 1.0/change |
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
var xyz = {}; | |
xyz.receiverURL = '.res/save-proxy-image.php'; | |
xyz.resizeImage = function(img, dstw, dsth, fit) { | |
try { | |
var w = dstw; | |
var h = dsth; | |
if (img.naturalWidth === 0 || img.naturalHeight === 0) | |
return null; | |
if (img.naturalWidth > dstw || img.naturalHeight > dsth) { | |
if (fit) { |
OlderNewer