This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'truemail' | |
require 'minitest/spec' | |
require 'minitest/autorun' | |
Truemail.configure do |config| | |
config.verifier_email = '[email protected]' | |
config.smtp_safe_check = true # setting to false makes SMTP validation fail | |
end | |
def valid?(email) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post '/contact' do | |
configure_options | |
Pony.mail( | |
:from => [params[:name], "<", params[:email], ">"].join, | |
:to => '[email protected]', | |
:subject => ["Opt-in via /contact: ", params[:name]].join, | |
:body => [params[:name], params[:email]].join(": ") | |
) | |
redirect '/' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
This is a heavily modified version of Wilson Miner's Timeline Charts example from | |
A List Apart #256 (http://alistapart.com/article/accessibledatavisualization). Accomodates | |
a list of stacked subvalues within a single bar segment. | |
--> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html lang="en"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
This is a heavily modified version of Wilson Miner's Timeline Charts example from | |
A List Apart #256 (http://alistapart.com/article/accessibledatavisualization). Accomodates | |
a list of stacked subvalues within a single bar segment. | |
--> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html lang="en"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'docverter' | |
Docverter.base_url = 'http://c.docverter.com' | |
File.open("out.pdf", "w+") do |f| | |
f.write(Docverter::Conversion.run do |c| | |
c.from = "markdown" | |
c.to = "pdf" | |
c.add_input_file("input.md") | |
# c.stylesheet = "stylesheet.css" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Template: template_index | |
%section | |
%h1 Recent articles | |
%ol.recent-articles | |
- latest_articles(5).each do |article| | |
%li.group | |
%div.half | |
= haml :page_date, :layout => false, :locals => { :page => article } | |
%h1.article-heading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Nesta | |
class App | |
post '/contact' do | |
configure_options | |
Pony.mail( | |
:from => params[:name] + "<" + params[:email] + ">", | |
:to => '[email protected]', | |
:subject => params[:name] + " has contacted you", | |
:body => params[:message] | |
) |
NewerOlder