Skip to content

Instantly share code, notes, and snippets.

View dstrelau's full-sized avatar

Dean Strelau dstrelau

View GitHub Profile
@dstrelau
dstrelau / caveatPatchor.js
Created June 23, 2011 15:14 — forked from protocool/caveatPatchor.js
caveatPatchor.js file for use in Propane
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();
@dstrelau
dstrelau / a.rb
Created May 10, 2011 18:04 — forked from rondevera/results.txt
#define_method vs ActiveSupport::StringInquirer
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
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
@dstrelau
dstrelau / tnt.rb
Created December 21, 2009 15:19 — forked from rodreegez/tnt.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'twitter'
class TNT < Thor
map "MESSAGE" => :post
desc "post \"message\"", "Post a message to Twitter"