Skip to content

Instantly share code, notes, and snippets.

Troels Knak-Nielsen troelskn

Block or report user

Report or block troelskn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View resque_cheatsheet.markdown

Status

Resque.info
Resque.queues
Resque.redis
Resque.size(queue_name)

# check out what's coming next in the queue
#    Resque.peek(archive_queue)
@dirtyhenry
dirtyhenry / poc-openssl-aes.rb
Last active Jun 5, 2018
Encryption interoperability demo between Ruby and OpenSSL
View poc-openssl-aes.rb
require 'openssl'
require 'base64'
# Read the dummy file
data = File.read("test.txt")
# Create an encrypter
cipher = OpenSSL::Cipher::AES.new(256, :CBC)
cipher.encrypt
key = cipher.random_key
View net-http-debug.rb
BEGIN {
require 'net/http'
Net::HTTP.module_eval do
alias_method '__initialize__', 'initialize'
def initialize(*args,&block)
__initialize__(*args, &block)
@sunlightlabs
sunlightlabs / levenshtein.rb
Created Aug 19, 2009
Ruby C implementation of Levenshtein
View levenshtein.rb
# C implementation of Levenshtein text distance algorithm, uses RubyInline to call from within Ruby
# Wildly faster than the Text gem's Text::Levenshtein
# Example:
# l = Levenshtein.new
# l.distance 'hello', ' hello'
# => 1
# Taken from http://www.benallfree.com/2008/10/05/finding-duplicate-text-with-ruby/
You can’t perform that action at this time.