Skip to content

Instantly share code, notes, and snippets.

@sjorz
sjorz / CompanyOwnerExport.sql
Created May 3, 2012 02:06
Company owner export from legacy
#
# Select all company owner users from legacy database
#
select
Member.Username as username,Member.Password as password,
Person.Salutation as salutation, Person.Firstname as first_name,Person.Surname as last_name,Person.email,Person.Mobile as mobile_number,
Company.CompanyID as legacy_company_id, Company.CompanyName as name,
Address.vcStreetNo as street_no, Address.vcStreetName as street_name, Address.vcStreettype as street_type, Address.vcSuburb as suburb, Address.intPostCode as postcode, Address.vcAddress1 as address1
from person
join Member on Person.MemberID=Member.MemberID
@sjorz
sjorz / Replace MS Word Characters
Created December 19, 2012 02:08
MS Word character replacement, improved version
def replace_ms_word_characters(s)
s_new = ""
s.each_byte do |b|
cr = b.chr
cr = "*" if b == 0x95
cr = '"' if b == 0x93 || b == 0x94
cr = "'" if b == 0x91 || b == 0x92
s_new << cr
end
return s_new