Skip to content

Instantly share code, notes, and snippets.

mic-kul / collector.rb
Created Oct 24, 2015
NewRelic local collector
View collector.rb
require 'sinatra'
require 'sinatra/namespace'
require 'sinatra/json'
require 'base64'
require 'json'
require 'zlib'
require 'stringio'
require 'pry'
mic-kul / cert2bundle.rb
Created Mar 24, 2016
generate #ready-to-use-with-nginx bundle.crt from single certificate
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 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)
# Ruby > 2.x
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE if Rails.env.development?
mic-kul / spacy_intro.ipynb
Created Feb 22, 2018 — forked from aparrish/spacy_intro.ipynb
NLP Concepts with spaCy. Code examples released under CC0, other text released under CC BY 4.0
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 textstream.rb
def self.file_path_to_text(path)
# TODO: exception handling
pdfParser =, "r"))
pdDocument =;
pdfTextStripper =
string = pdfTextStripper.getText(pdDocument);
return string