Skip to content

Instantly share code, notes, and snippets.

View JohnZavyn's full-sized avatar

John A. Marsh JohnZavyn

View GitHub Profile
@JohnZavyn
JohnZavyn / pom.xml
Last active May 1, 2018 18:47
Spring Boot Maven Plugin that Includes all dependency JARs in a WAR or JAR package
...
<packaging>war</packaging>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
@JohnZavyn
JohnZavyn / my_sql_encryption.rb
Created May 14, 2018 18:46
MySQL AES Encryption for Ruby
require 'openssl'
# This module provides AES encryption compatible with MySQL AES_ENCRYPT
# and AES_DECRYPT functions.
module MySQLEncryption
# Takes an unencrypted text string, encrypts it with the password,
# and encodes the results to a hexadecimal string
def self.mysql_encrypt(unencrypted_text, password)
encrypt(unencrypted_text, mysql_key(password))
require 'my_sql_encryption'
text = 'Sensitive data'
encrypted = MySQLEncryption.mysql_encrypt(text, @password)
decrypted = MySQLEncryption.mysql_decrypt(encrypted, @password)
log.info("Encrypted: #{encrypted}")
log.info("Decrypted: #{decrypted}")
expect(decrypted).to eq(text)
@JohnZavyn
JohnZavyn / .gitattributes
Created November 15, 2024 09:48
An example configuration that will allow you to use git to create a zip file with the current project while ignoring specific files and folders.
# For use with git archive command:
# git archive --worktree-attributes --format=zip --output="$(basename "$PWD").zip" HEAD
* text=auto eol=lf
*.php diff=php
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore