Skip to content

Instantly share code, notes, and snippets.

@sonishchuk
sonishchuk / rails http status codes
Created February 2, 2022 15:40 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@sonishchuk
sonishchuk / decrypt.js
Created January 9, 2022 11:00 — forked from jrue/decrypt.js
Encrypt static HTML with Ruby and CryptoJS.
var payload = "{{ content | encrypt_data }}".split("|"); //content via Ruby
var iv = payload[0]
hmac = payload[1],
cipherText = payload[2];
//CryptoJS keeps all objects as WordArrays, so you have to coerce as strings at times.
//Only get passphrase via input or cookie, convert to sha256 hex digest
//echo -n "passphrase" | openssl dgst -sha256