Skip to content

Instantly share code, notes, and snippets.

View MaxLap's full-sized avatar

Maxime Lapointe MaxLap

View GitHub Profile
@MaxLap
MaxLap / encrypt_openssl.md
Created October 24, 2024 20:44 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

require "benchmark"
require "colorize"
require "http"
require "spec/dsl"
class String
private PRIME_RK = 2097169u32
def index_old(search : String, offset = 0)
offset += size if offset < 0
@MaxLap
MaxLap / rubocop.rb
Last active March 12, 2024 17:15 — forked from skanev/rubocop.rb
A Rubocop wrapper that checks only added/modified code
#!/usr/bin/env ruby
# A sneaky wrapper around Rubocop that allows you to run it only against
# the recent changes, as opposed to the whole project. It lets you
# enforce the style guide for new/modified code only, as opposed to
# having to restyle everything or adding cops incrementally. It relies
# on git to figure out which files to check.
#
# Here are some options you can pass in addition to the ones in rubocop:
#