Skip to content

Instantly share code, notes, and snippets.

Ruskin jonnyparris

View GitHub Profile
@jonnyparris
jonnyparris / openssl
Created May 2, 2020
Basica file encryption and decryption with openssl via the commandline
View openssl
# encrypt file.txt to file.enc using 256-bit AES in CBC mode
openssl enc -aes-256-cbc -salt -in file.txt -out file.enc
# the same, only the output is base64 encoded for, e.g., e-mail
openssl enc -aes-256-cbc -a -salt -in file.txt -out file.enc
# To decrypt file.enc you or the file’s recipient will need to remember the cipher and the passphrase.
# decrypt binary file.enc
openssl enc -d -aes-256-cbc -in file.enc
@jonnyparris
jonnyparris / cy-commands.js
Created Apr 15, 2020
Cypress util commands
View cy-commands.js
Cypress.Commands.add('getInputByName', name => {
return cy.get(`[name="${name}"]`);
});
Cypress.Commands.add('getByTestTag', tag => {
return cy.get(`[data-test-id="${tag}"]`);
});
Cypress.Commands.add('clickRecaptcha', () => {
cy.window().then(win => {
@jonnyparris
jonnyparris / Copy package.json to dist folder
Created Apr 17, 2019
Generated distribution-friendly package.json at dist/package.json (without devDependencies)
View Copy package.json to dist folder
const fs = require('fs')
const DIST_SCRIPTS = {
'start': 'npm run start-main-script'
}
fs.readFile('package.json', 'utf8', (err, data) => {
const distPackage = JSON.parse(data)
distPackage['scripts'] = DIST_SCRIPTS
delete distPackage['devDependencies']
@jonnyparris
jonnyparris / prepare-commit-msg.sh
Last active May 6, 2020 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with the Jira ticket reference from a branch name
View prepare-commit-msg.sh
#!/bin/bash
# For instance with feature/add_new_feature_HEYT-653
# $ git commit -m"Fixed bug"
# will result with commit "[HEYT-653] Fixed bug"
# Customize which branches should be skipped when prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
You can’t perform that action at this time.