Skip to content

Instantly share code, notes, and snippets.

View muuki88's full-sized avatar
๐Ÿ˜˜
Taking care of my daugther

Muki Seiler muuki88

๐Ÿ˜˜
Taking care of my daugther
View GitHub Profile
@muuki88
muuki88 / KeyValueStore.serialization.ts
Created September 14, 2018 08:29
KeyValueStore Serialization
const deserializeBoolean = (value: string) => value === 'true';
const deserializeString = (value: string) => value;
const deserializeNumber = (value: string) => parseInt(value);
const serializeBoolean = (value: boolean) => value ? 'true' : 'false';
const serializeString = (value: string) => value;
const serializeNumber = (value: number) => number.toFixed();
/**
* Each key-value storage key needs a function to deserialize its string value
* from the database into its own type. Each type is specified in KeyValueStorage.
@muuki88
muuki88 / adtag.js
Last active May 28, 2024 21:40
TCF 2.2 Wait for consent
// example loading adtag.js , 755 is the google vendor id
loadWithConsent(755, [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], function() {
var adtag = document.createElement('script');
adtag.type = 'module'; adtag.async = true;
adtag.src = 'https://studis.h5v.eu/latest/moli.min.mjs';
var outs = document.getElementsByTagName('script')[0];
outs.parentNode.insertBefore(adtag, outs);
});