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
def flater(arr): | |
result = [] | |
for el in arr: | |
if isinstance(el, list): | |
result = result + flater(el) | |
else: | |
result.append(el) | |
return result |
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
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6, | |
p,blockquote,pre,a,abbr,acronym,address,big,code,em,img, | |
small,strong,sub,sup,tt,b,u,i,center, | |
ol,ul,li,table,caption,tbody,tfoot,thead,tr,th,td { | |
margin:0; | |
padding:0; | |
border:0; | |
font-size:100%; | |
font:inherit; | |
vertical-align:baseline; |
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
# GET request | |
get '/envelope-sample' do | |
haml :envelope_sample | |
end | |
# POST request to handle callback when document was signed | |
post '/envelope-sample/sign' do | |
# Content Type of callback is application/json | |
data = JSON.parse(request.body.read) | |
begin |
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
# GET request | |
get '/envelope-sample' do | |
haml :envelope_sample | |
end | |
# POST request | |
post '/envelope-sample' do | |
haml :envelope_sample | |
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
%h3{:style => "text-align:center;"} | |
%a{:href => "/"} GroupDocs Ruby SDK Samples | |
\- Envelope sample | |
.samplecontent{:style => "padding:10px;"} | |
%i This sample will show how to use envelope and signature API using Ruby SDK | |
%br/ | |
%i You can find documentation for this sample | |
%a{:href => "/docs/envelope-sample.html"} here | |
%br/ | |
%br/ |
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 'sinatra' | |
require 'groupdocs' | |
require 'haml' | |
get '/' do | |
haml :index | |
end | |
get '/style.css' do | |
sass :style |
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
source :rubygems | |
gem 'sinatra' | |
gem 'groupdocs' | |
gem 'haml' |