Skip to content

Instantly share code, notes, and snippets.

@dayreiner
dayreiner / example-compose-mariadb-galera.yml
Last active April 5, 2017 15:50
Example compose file for a test galera cluster on a single host, as part of an answer to this Stack Exchange: http://stackoverflow.com/questions/41573048/how-to-debug-wsrep-sst-failed-1-operation-not-permitted-with-a-mariadb-gal/41622952#41622952
version: '2'
services:
db-bootstrap:
image: dayreiner/centos7-mariadb-10.1-galera:latest
container_name: db1
restart: never
expose:
- "3306"
- "4567"
- "4568"
@dayreiner
dayreiner / gtin_generate_check_digit_and_case_code.sql
Created September 28, 2022 01:34
Example MariaDB database for storing product GTINs and automatically generating the GS1 check digit and GTIN Master Case Code
--
-- @dayreiner | https://18pct.com/ | https://sensibrands.ca | https://github.com/dayreiner
--
-- An example database for storing product GTINs and generating the GS1 check digit and GTIN master case code.
-- When an 11-digit GTIN is inserted, a trigger calls the function to generate the GS1 check digit and insert it into the check_digit column.
-- A second trigger generates the master case code GTIN and inserts that value in the master_case_code column.
-- Expanded upon from the function in this article: https://www.anycodings.com/1questions/4958850/check-for-invalid-upc-in-mysql
--
-- After creating the gtin database, you can insert a gtin to test that the check digit and case code are correctly added:
--
@dayreiner
dayreiner / enterprise_token.rb
Created May 26, 2023 17:46 — forked from markasoftware/enterprise_token.rb
OpenProject Enterprise mode for free
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
############ also be sure to RESTART OpenProject after replacing the file. ################
############ it doesn't show that enterprise mode is enabled in the settings, but all ################
############ enterprise mode features, such as KanBan boards, are enabled. ################
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.