This file contains hidden or 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 self.file_path_to_text(path) | |
# TODO: exception handling | |
pdfParser = PDFParser.new(RandomAccessFile.new(Java::JavaIo::File.new(path), "r")) | |
pdfParser.parse() | |
pdDocument = PDDocument.new(pdfParser.getDocument()); | |
pdfTextStripper = PDFLayoutTextStripper.new | |
string = pdfTextStripper.getText(pdDocument); | |
return string | |
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
# initializers/bypass_openssl_verification.rb | |
require 'openssl' | |
# Ruby 1.9.3: | |
if Rails.env.development? | |
OpenSSL::SSL.send(:remove_const, :VERIFY_PEER) | |
OpenSSL::SSL.const_set(:VERIFY_PEER, OpenSSL::SSL::VERIFY_NONE) | |
end | |
# Ruby > 2.x | |
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE if Rails.env.development? |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# cert2bundle.rb | |
# author: @mic-kul | |
# USAGE: ./cert2bundle.rb some.domain.crt | |
# generates #ready-to-use-with-nginx bundle.crt in current working directory | |
require "openssl" | |
require "net/http" | |
require "uri" |
This file contains hidden or 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 'sinatra/namespace' | |
require 'sinatra/json' | |
require 'base64' | |
require 'json' | |
require 'zlib' | |
require 'stringio' | |
require 'pry' |