This file contains hidden or 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 "test_helper" | |
module Chevalet | |
class ImageTest < ImageTestCase | |
%w(gif jpg png).each do |format| | |
test "validates a real #{format} image" do | |
image(format.to_sym) do |data| | |
image = Image.new(data) | |
assert image.send("#{format}?") | |
end |
This file contains hidden or 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
image = Magick::Image.read("caption:#{text}") do | |
self.font = params["font"] | |
end |
This file contains hidden or 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
module Intercept | |
class << self | |
attr_reader :interceptors | |
def intercept(command, method=nil, &block) | |
interceptor = { :command => command, :action => method || block } | |
(@interceptors ||= []) << interceptor | |
end | |
end | |
This file contains hidden or 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
module EventMachine | |
class StderrHandler < EventMachine::Connection | |
def initialize(connection) | |
@connection = connection | |
end | |
def receive_data(data) | |
@connection.receive_stderr(data) | |
end | |
end |
This file contains hidden or 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
"</td><td><font color=\"#b45fb4\"><tt>starspun</tt></font></td><td width=\"100%\"><tt>This one had SO</tt></td></tr>\n" | |
"</td><td><font color=\"#b45fb4\"><tt>starspun</tt></font></td><td width=\"100%\"><tt>MUCH</tt></td></tr>\n" | |
"</td><td><font color=\"#b45fb4\"><tt>starspun</tt></font></td><td width=\"100%\"><tt>PELVIC</tt></td></tr>\n" | |
"</td><td><font color=\"#b45fb4\"><tt>starspun</tt></font></td><td width=\"100%\"><tt>THRUSTING</tt></td></tr>\n" | |
"</td><td><font color=\"#6ccdcd\"><tt>Noxy</tt></font></td><td width=\"100%\"><tt>... Raws, are you gay?</tt></td></tr>\n" |
This file contains hidden or 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 "json" | |
class Jsonify | |
def initialize(app) | |
@app = app | |
end | |
def call(env) |
This file contains hidden or 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 "json" | |
after do | |
response.body = response.body.to_json | |
content_type :json | |
end | |
get "/foo" do |
This file contains hidden or 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
set realmlist us.logon.worldofwarcraft.com | |
set patchlist enUS.patch.battle.net:1119/patch | |
set realmlistbn "" | |
set portal us |
This file contains hidden or 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
/* | |
* Asserts to use in Objective-C method bodies | |
*/ | |
#define NSAssert5(condition, desc, arg1, arg2, arg3, arg4, arg5) \ | |
_NSAssertBody((condition), (desc), (arg1), (arg2), (arg3), (arg4), (arg5)) | |
#define NSAssert4(condition, desc, arg1, arg2, arg3, arg4) \ | |
_NSAssertBody((condition), (desc), (arg1), (arg2), (arg3), (arg4), 0) |
This file contains hidden or 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
if (condition) | |
{ | |
// HUGE BLOCK OF CODE | |
} | |
else | |
[self setErrorMessage:WHLocalizedString(@"Unsupported realm")]; | |
[self setStatusMessage:WHLocalizedString(@"Upload successful")]; | |
// ... |