View textstream.rb
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 |
View spacy_intro.ipynb

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View bypass_openssl_verification.rb
# 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? |
View cert2bundle.rb
#!/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" |
View collector.rb
require 'sinatra' | |
require 'sinatra/namespace' | |
require 'sinatra/json' | |
require 'base64' | |
require 'json' | |
require 'zlib' | |
require 'stringio' | |
require 'pry' |