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:
class NegatedMethodRewriter < Parser::TreeRewriter | |
def on_send(node) | |
receiver_node, method_name, *arg_nodes = *node | |
if receiver_node && method_name == :! && arg_nodes.size == 1 | |
remove(node.location.selector) | |
insert_before(node.location.expression, "!(") | |
insert_after(node.location.expression, ")") | |
else |
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
gem "rails", github: "rails/rails" |
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
gem "rails", github: "rails/rails" |
# This script will list asset files which are used and those which aren't for a Rails 3.2 application. | |
# | |
# It works by prefixing/suffixing all (js css less scss sass coffee) files. Then, after having run | |
# rake assets:precompile, you can run the script again and it will search in public/assets for | |
# those prefix to know if the file is definetly not used, or if it could be used. | |
root_dirs = %w(app/assets vendor) | |
file_endings = %w(js css less scss sass coffee) | |
file_paths_to_handle = root_dirs.flat_map {|d| file_endings.flat_map {|fe| Dir["#{d}/**/*.#{fe}"] } }.sort |
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 |
#!/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: | |
# |
module HamlHelper | |
def coffee_with_locals locals={}, &block | |
# This helper will set locals as values inside of the :coffeescript filter that follows. | |
# Doing this instead of using regular interpolation allows haml to keep a compiled version of the CoffeeScript | |
# instead of having to compile on every render after the interpolation is applied. On Linux, the impact is | |
# negligible because V8 is fast, but Windows environments don't have this chance and page rendering can be slowed | |
# heavily from having to compile CoffeeScript. | |
block_content = capture_haml do |