Skip to content

Instantly share code, notes, and snippets.

View srih4ri's full-sized avatar
🔥
Lighting things on fire, brb

Srihari srih4ri

🔥
Lighting things on fire, brb
View GitHub Profile
@srih4ri
srih4ri / translate.rb
Created March 16, 2011 15:35
Generates a new ml.yml using the current en.yml , using old ml.yml's translated string wherever possible . This is really ugly though , there must be something that actually does this neatly
# encoding: UTF-8
require 'yaml'
sf = File.open("original_ml.yml", "r")
src = YAML::load(sf.read)
sf.close
rf = File.open("current_en.yml", "r")
ref = YAML::load(rf.read)
rf.close
@srih4ri
srih4ri / malayalam_pdf.rb
Created February 22, 2011 18:48
Generate PDF documents containing malayalam using prawn
require 'rubygems'
gem 'prawn','=0.6.3'
require 'prawn'
words = "പോടാ മണ്ട is the new foo bar."
Prawn::Document.generate "example.pdf" do |pdf|
pdf.font 'rachana.ttf'
pdf.text words
end