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
Time::ReportsController#index (NoMethodError) "undefined method `quoted_table_name' for Saulabs::Reportable::Report:Class" | |
/home/madrobby/webapps/freckle.com/releases/20100530163247/vendor/rails/activerecord/lib/active_record/reflection.rb:187:in `quoted_table_name' | |
/home/madrobby/webapps/freckle.com/releases/20100530163247/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:97:in `construct_sql' | |
/home/madrobby/webapps/freckle.com/releases/20100530163247/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:21:in `initialize' | |
/home/madrobby/webapps/freckle.com/releases/20100530163247/vendor/rails/activerecord/lib/active_record/associations.rb:1300:in `new' | |
/home/madrobby/webapps/freckle.com/releases/20100530163247/vendor/rails/activerecord/lib/active_record/associations.rb:1300:in `reports' | |
/home/madrobby/webapps/freckle.com/releases/20100530163247/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:217:in `send' | |
/home/madrob |
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
Object.extend(Date.prototype, { | |
strftime: function(format) { | |
var day = this.getDay(), month = this.getMonth(); | |
var hours = this.getHours(), minutes = this.getMinutes(); | |
return format.gsub(/\%([aAbBcdDHiImMpSwyY])/, function(part) { | |
switch(part[1]) { | |
case 'a': return $w("Sun Mon Tue Wed Thu Fri Sat")[day]; break; | |
case 'A': return $w("Sunday Monday Tuesday Wednesday Thursday Friday Saturday")[day]; break; | |
case 'b': return $w("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")[month]; break; |
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
Function.prototype.cached = function(){ | |
var self = this, cache = {}; | |
return function(arg){ | |
if(arg in cache) return cache[arg]; | |
return cache[arg] = self(arg); | |
} | |
} |
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
Function.prototype.cached = function(){ | |
var self = this, cache = {}; | |
return function(arg){ | |
if(arg in cache) return cache[arg]; | |
return cache[arg] = self(arg); | |
} | |
} |
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
<!-- Inside the loop, for each post --> | |
<a href="http://twitter.com/share?url=<?php print(urlencode(get_permalink())) ?>&text=<?php print(urlencode(get_the_title())) ?>" class="twitter-share-button" data-count="horizontal" data-via="thomasfuchs">Tweet</a> | |
<!-- in your footer --> | |
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> |
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
just a gist |
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 truth = "This is the one true chat, IMHO"; |
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
function createArray(nativeObject){ return [].slice.call(nativeObject); } |
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
// Solution to Part 2. | |
function isPrime(num) { | |
var prime = num != 1; | |
for ( var i = 2; i < num; i++ ) { | |
if ( num % i == 0 ) { | |
prime = false; | |
break; | |
} | |
} |
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
// Solution to Part 1. | |
Function.prototype.cached = function(){ | |
var self = this, cache = {}; | |
return function(arg){ | |
if(arg in cache) return cache[arg]; | |
return cache[arg] = self(arg); | |
} | |
} |