Skip to content

Instantly share code, notes, and snippets.

@kelmerp
kelmerp / HOWTO.md
Last active May 18, 2024 12:39 — forked from ivanvermeyen/HOWTO.md
Multiple MySQL versions on MacOS with Homebrew

Update - 4 september 2020

Making multiple MySQL versions work with Homebrew was tricky to say the least. Fortunately there are 2 new easy ways that I learned of to achieve this.

DBngin app

As @4unkur and @henrytirla commented below, there is this extremely easy to use app called DBngin, which lets you setup multiple databases (not only MySQL) simultaneously using different ports:

https://dbngin.com/

@kelmerp
kelmerp / gist:f4d72ee501db588ac21ef1c3ff758a40
Created August 15, 2024 15:50
bh db wipe; reset tables on our end
irb(main):005:0> Corp::BhReservationRequest.distinct(:bh_user_info_id).pluck(:bh_user_info_id)
=> ["08aa7047-da53-447f-9873-3c2155c2fb9e", "08afc806-ff07-46ec-b90e-fb0fd75806c0", "0a42b13b-6374-42d6-9720-747e6234fe04", "0a70fee5-362c-4f29-b750-3914e6f1a9ed", "0beb079e-1fda-48ea-b659-b6fae092071d", "10681110", "109487b5-191f-4869-82eb-0151d134d63d", "14153983", "16431310", "1689bbfb-f072-4e81-88d4-4223351171e4", "17652199", "19945996", "1af107b5-a718-4fbe-aa37-6c05c14ce080", "1c5472ce-8276-ed11-a866-005056993f98", "1d7766ca-f405-ec11-a858-005056993f98", "1f36d445-ba66-48c5-bec3-244a745062d5", "20214407", "205bb208-21ed-4fe5-9697-669895e38510", "214fa430-a852-4424-ad70-f0b6342ef2bf", "269f1e3f-d51c-4a23-a5f3-eb6197d56c87", "27964329", "28289464", "2b6dec2e-362b-4305-8d72-d0372c4c4b63", "2bf2843a-eaf8-4ee4-9050-13ddb437b280", "2c262371-faea-e911-a842-005056993f98", "2f5e762a-bc5a-4aff-a30c-4aa76313c374", "2f8da8b7-0da0-4b5a-85de-65372453ce15", "30041851", "3128cfcb-e4f1-4ec6-a685-cd6d18aaba58", "31c0ed20-3b5d-46
@kelmerp
kelmerp / csp-hash.js
Created April 2, 2025 20:38 — forked from rubenarakelyan/csp-hash.js
Calculate the CSP hash of a script in the browser console
const scripts = document.getElementsByTagName("script"),
script_content = scripts[scripts.length - 1].innerHTML,
enc = new TextEncoder(),
data = enc.encode(script_content);
crypto.subtle.digest('SHA-256', data).then(function(val) {
const digest = ["sha256", _arrayBufferToBase64(val)].join("-");
console.log(`The digest for your script is: ${digest}`);
});