Skip to content

Instantly share code, notes, and snippets.

Universal Data Model

In business, master data management (MDM) is a method used to define and manage the critical data of an organization to provide, with data integration, a single point of reference.[1] The data that is mastered may include reference data - the set of permissible values, and the analytical data that supports decision making.[2]

In computing, a master data management tool can be used to support master data management by removing duplicates, standardizing data (mass maintaining),[3] and incorporating rules to eliminate incorrect data from entering the system in order to create an authoritative source of master data. Master data are the products, accounts and parties for which the business transactions are completed. The root cause problem stems from business unit and product line segmentation, in which the same customer will be serviced by different product lines, with redundant data being entered about the customer (a.k.a. party in the role of customer) and account in order to proc

@RobertAKARobin
RobertAKARobin / safari.md
Last active January 5, 2024 05:41
Safari's date-picker is the cause of 1/3 of our customer support issues

Safari's date-picker is the cause of 1/3 of our customer support issues

...and obviously we're building a workaround. But I'm absolutely flabbergasted that a standard <input type="date"> HTML field, in a standard browser, from a company that bases its reputation good design, could be so dreadful.

The context

I'm the developer for a startup that sells a genetic test to recommend medications for high blood pressure. For medical reasons we need to know our customers' birth date. Most of our customers are in their 60s or older. We've found that many of them use iPads or iPhones. And they're the ones who complain to our customer support that our site is unusable.

The problem

@andrewchilds
andrewchilds / deepGet.js
Last active January 11, 2023 22:38 — forked from harish2704/lodash.get.js
Simple, standalone, vanilla implementation of lodash.get
// Simple implementation of lodash.get
// Handles arrays, objects, and any nested combination of the two.
// Also handles undefined as a valid value - see test case for details.
// Based on: https://gist.github.com/harish2704/d0ee530e6ee75bad6fd30c98e5ad9dab
export function deepGet(obj, query, defaultVal) {
query = Array.isArray(query) ? query : query.replace(/(\[(\d)\])/g, '.$2').replace(/^\./, '').split('.');
if (!(query[0] in obj)) {
return defaultVal;
}
obj = obj[query[0]];
@jclaveau
jclaveau / pre-commit
Last active December 13, 2022 10:13
Replace all variables between brackets like "{{ remote.origin.url }}" by their values retrieved from git
#!/bin/sh
# https://www.viget.com/articles/two-ways-to-share-git-hooks-with-your-team/
# git config core.hooksPath .githooks
# run from the root of the repo
.githooks/replace_by_git_vars.py readme.md README.md
# If your filesystem is not case-sensitive you can use
# .githooks/replace_by_git_vars.py README.template.md README.md
@adamchainz
adamchainz / _base.html
Created January 8, 2021 14:34
Django HTMX CSRF setup
<script src="{% static 'app.js' %}" data-csrftoken="{{ csrf_token }}"></script>

CRSF Handling

Handling CRSF in htmx is server-side platform dependent, but typically involves something like the following to add a token to a header or parameter:

Vanilla JS

In pure javascript you can listen to the htmx:configRequest event and set the token there:

@linuxkathirvel
linuxkathirvel / fix-domain-name-provided-is-not-valid-according-to-RFC-1034_1035.md
Last active March 31, 2023 06:35
How to fix "DisallowedHost at / Invalid HTTP_HOST header:. The domain name provided is not valid according to RFC 1034/1035." error in Django?

How to fix "DisallowedHost at / Invalid HTTP_HOST header:. The domain name provided is not valid according to RFC 1034/1035." error in Django?

Solution

  • Don't add include proxy_params; in Django application's NGINX configuration file.
  • Cross-check the Django application's NGINX configuration. If include proxy_params; line added, remove it.
  • proxy_params(/etc/nginx/proxy_params) file have proxy_set_header Host $http_host; line already. It will override proxy_set_header Host $host;

Related notes

  1. Security configurations in Django while deploying on production
  2. How to fix ERR_TOO_MANY_REDIRECTS issue in Django+Gunicorn+NGINX?

References

@kocienda
kocienda / SJ-D8.txt
Last active December 2, 2020 22:00
D8: Steve Jobs
Things are packages of emphasis. Some things are emphasized in a product. Some things are not done as well in a product. Some things are chosen not to be done at all in a product. Different people make different choices, and if the market tells us we’re making the wrong choices, we listen to the market. We’re just people running this company. We’re trying to make great products for people, and so, at least we have the courage of our convictions to say, “We don’t think this is part of what makes a great product. We’re going to leave it out.”
Some people are not going to like that. They’re going to call us names. It’s not going to be a certain company’s vested interest that we do that, but we’re going to take the heat, because we want to make the best product in the world for customers. We’re going to instead focus our energy on these technologies, which we think are in their ascendency, and we think are going to be the right technologies for customers.
And you know what? They’re paying us to make those cho
@vhermecz
vhermecz / custom_keys_git_ssh
Created June 8, 2020 11:20
Allow configuring multiple ssh deploy keys with git
#!/bin/bash
# Script to use custom ssh keys for various git repositories
# Run without arguments to get usage info.
#
# How it works:
# When used with SSH, git sends the path to the repository in the SSH command.
# @see: https://github.com/git/git/blob/e870325/connect.c#L1268
# We extract this info and search for a key with the name.
# Based on the source, this seems to be used format since v2.0 at least.
# @see: https://github.com/git/git/commit/a2036d7
@slorber
slorber / react-navigation-tree.jsx
Last active August 13, 2022 19:17
react-navigation-tree.jsx
const App = createAppContainer(
createStack({
LoggedSwitch: createSwitch({
// When user is authenticated
LoggedIn: createStack({
// The logged in root is generally a tab or drawer navigator
LoggedInRoot: createTabsOrDrawer({