How To Enable IFrame Support on Heroku with Ruby on Rails and Sinatra
This actually has more to do with Rails and/or Sinatra than it does with Heroku. You have to enable IFrame support in your headers explicitly.
With Rails you can add this to your config/application.rb file
config.action_dispatch.default_headers = ...
Written by Sean Behan on 08/25/2013
NO Table Cell Spacing Please
Remove cell padding on a table you add the cellspacing attribute and set it to "0". Is there a better way to do this with straight up CSS? Nothing seems to work...
<table id='my-favorite-table' cellspacing="0" >
...
Written by Sean Behan on 06/17/2012
How To Use Rake to Run Your Test Suite with Sinatra
If you're using Sinatra and you want to use rake to run your test suite, you will need to create a Rakefile and put this in it.
require 'rake/testtask'
task :default do
ENV['RACK_ENV'] = 'test'
Rake::Task['test'].invoke
end
Rake::Test...
Written by Sean Behan on 08/22/2013
How to Boot Up Multiple Sinatra Applications at the Same Time with Foreman
Foreman is a process management gem for ruby applications. It is used in combination with a Procfile for configuration instructions.
A typical Procfile looks something like this
[name] : [script to execute]
Example Rack application Procfile
...
Written by Sean Behan on 10/15/2013
Extension for Encoding and Decoding Strings in Base64 in Swift
Here is an extension to base 64 encode and decode strings in Swift (3)
extension String {
func fromBase64() -> String? {
guard let data = Data(base64Encoded: self) else {
return nil
}
return String(data: data, encoding: ....
Written by Sean Behan on 05/02/2018