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 displayAvatars = true; | |
var displayCloudAppImages = true; | |
var displayGists = true; | |
if (displayAvatars) { | |
Object.extend(Campfire.Message.prototype, { | |
addAvatar: function() { | |
if (this.actsLikeTextMessage()) { | |
var author = this.authorElement(); |
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
class A | |
attr_accessor :kind | |
def initialize(kind) | |
self.kind = kind | |
end | |
def one? ; self.kind == 'one' ; end | |
def two? ; self.kind == 'two' ; end | |
def three? ; self.kind == 'three' ; 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
mysql> EXPLAIN SELECT count(DISTINCT `competition_entries`.id) AS count_all FROM `competition_entries` LEFT OUTER JOIN `videos` ON `videos`.attachable_id = `competition_entries`.id AND `videos`.attachable_type = 'CompetitionEntry' LEFT OUTER JOIN `moderations` ON `moderations`.moderated_id = `competition_entries`.id AND `moderations`.moderated_type = 'CompetitionEntry' LEFT OUTER JOIN `users` ON `users`.id = `competition_entries`.user_id INNER JOIN `images` ON `images`.attachable_id = `competition_entries`.id AND `images`.attachable_type = 'CompetitionEntry' WHERE (moderations.state = 0) ; | |
+----+-------------+---------------------+--------+-----------------------------------------------------------------------+-----------------------------------+---------+--------------------------------------------------+------+-------------+ | |
| id | select_type | table | type | possible_keys | key | key_len | ref |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'thor' | |
require 'twitter' | |
class TNT < Thor | |
map "MESSAGE" => :post | |
desc "post \"message\"", "Post a message to Twitter" |