Skip to content

Instantly share code, notes, and snippets.

@hersha
hersha / barfu.rb
Created November 2, 2012 16:12 — forked from thepleb/barfu.rb
highcharts stacked bar graph
## use lazy_high_charts to make a horizontal stacked bar chart
# in the controller
@h = LazyHighCharts::HighChart.new('graph') do |f|
f.options[:chart][:defaultSeriesType] = "bar"
f.options[:title][:text] = "Sample Title Text"
f.legend(:reversed => 'true')
f.xAxis(:categories=>['Cat1',
'Cat2',
'Cat3',
@hersha
hersha / Lines.rb
Created November 2, 2012 18:40 — forked from thepleb/Lines.rb
Line Chart for lazy_high_charts
# In the controller
@lineChart = LazyHighCharts::HighChart.new('graph') do |f|
f.options[:chart][:defaultSeriesType] = "line"
f.options[:title][:text] = "Chart Title"
f.xAxis(:categories=>['Jan', 'Feb', 'March', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'])
f.series(name: 'This Series', :data=> [1,2,3,4,5,6,7,8,9,10,9,8])
f.series(name: 'That Series', :data=> [10,9,8,7,5,6,7,8,9,10,9,8])
end
require 'openssl'
class MessageEncryptor
class << self
include OpenSSL
def delivering_email(message)
encrypted_message = sign_and_encrypt(message.encoded, message.to)
overwrite_body(message, encrypted_message)
overwrite_headers(message, encrypted_message)