Skip to content

Instantly share code, notes, and snippets.

@zaccari
zaccari / encryption.rb
Created February 27, 2020 06:55 — forked from yukithm/encryption.rb
[Ruby] A simple example of AES encryption in Ruby
# encoding: utf-8
require "openssl"
require "base64"
CIPHER_ALGO = "AES-256-CBC"
SALT_SIZE = 8
def encrypt(data, pass)
salt = OpenSSL::Random.random_bytes(SALT_SIZE)
@zaccari
zaccari / workers.rake
Created October 12, 2012 17:15 — forked from karmi/workers.rake
Rake taks to launch multiple Resque workers in development/production with simple management included
# Rake task to launch multiple Resque workers in development/production with simple management included
require 'resque/tasks' # Require Resque tasks
namespace :workers do
# = $ rake workers:start
#
# Launch multiple Resque workers with the Rails environment loaded,
# so they have access to your models, etc.