Skip to content

Instantly share code, notes, and snippets.

View Jirapong's full-sized avatar

Jirapong Nanta Jirapong

View GitHub Profile
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
# for this example the folder structure should be as follow
#
# --+ mailer
# |-- image.jpg
# |-- mailer.rb (this file)
# |--+ notifier
# |-- email.rhtml
require 'rubygems'
require 'action_mailer'
# 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)