Skip to content

Instantly share code, notes, and snippets.

View Jirapong's full-sized avatar

Jirapong Nanta Jirapong

View GitHub Profile
# For the queasy, this is MIT licensed. See comment at the end.
module MySQLEncryption
# Mimics MySQL's AES_ENCRYPT() and AES_DECRYPT() encryption functions
def mysql_encrypt(s, key)
encrypt(s, mysql_key(key))
end
def mysql_decrypt(s, key)
require 'rubygems'
require 'builder'
require 'PresentationCore'
require 'PresentationFramework'
require 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeytoken=b77a5c561934e089'
module XamlTools
include System::Windows
StringReader = System::IO::StringReader;
XamlReader = System::Windows::Markup::XamlReader
require 'xamltools.rb'
class MyCommand
include System::Windows::Input::ICommand
def add_CanExecuteChanged(h)
@change_handlers << h
end
def remove_CanExecuteChanged(h)
@change_handlers.remove(h)
end
describe "Widget#foo" do
it "does something" do
# This should be the functionality specs specific to the semantics of the method
Widget.new.foo.should == "do something"
end
end
# This captures the "type signature" of the method. Here are recipes for corner cases that you might forget.
# Note that the examples are not self-consistent by design. Only some of them might apply to any given method.
# However, the goal below is to include the union of all possible examples so that you can cut and paste
require 'active_record/connection_adapters/abstract_adapter'
require 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
require 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
module System
class DBNull
def nil?
true
end
end
describe "Widget#foo" do
it "does something" do
# This should be the functionality specs specific to the semantics of the method
Widget.new.foo.should == "do something"
end
end
# This captures the "type signature" of the method. Here are recipes for corner cases that you might forget.
# Note that the examples are not self-consistent by design. Only some of them might apply to any given method.
# However, the goal below is to include the union of all possible examples so that you can cut and paste