Skip to content

Instantly share code, notes, and snippets.

View dobesv's full-sized avatar

Dobes Vandermeer dobesv

View GitHub Profile
@dobesv
dobesv / BrowserChooser.desktop
Created March 16, 2023 17:52
Home-made Browser Picker for Linux
[Desktop Entry]
Name=Browser Chooser
GenericName=Browser Chooser
Comment=Choose what browser to use for specific links
Categories=Network;
Exec=browser-chooser %u
Type=Application
MimeType=x-scheme-handler/unknown;x-scheme-handler/about;text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https;
import { CookiePolicyAcceptance } from './CookiePolicyAcceptance';
import getStoredPolicyAcceptance from './getStoredPolicyAcceptance';
export type DataLayerName = 'dataLayer' | 'ga4DataLayer' | 'adwordsDataLayer';
export type GtagName = 'gtag' | 'adwordsGtag' | 'gtmGtag';
export const gtagFn = (
dataLayerName: DataLayerName,
gtagName: GtagName,
): ((..._args: any[]) => any) =>
import storage, {
AnalyticsStorage,
ANY,
GLOBAL,
} from '@analytics/storage-utils';
export interface ConsentAwareStorage extends AnalyticsStorage {
getConsent(): boolean;
setConsent(newValue: boolean): void;
}
import storage, {
AnalyticsStorage,
ANY,
GLOBAL,
} from '@analytics/storage-utils';
export interface ConsentStorage extends AnalyticsStorage {
getConsent(): boolean;
setConsent(newValue: boolean): void;
}
@dobesv
dobesv / boorkmarklet.md
Last active November 8, 2021 19:44 — forked from 71/boorkmarklet.md
Lists all participants in a Google Meet meeting.

The following bookmarket shows a popup with the name of the participants separated by newlines.

javascript:-function(maxStrLength = 2000) { try { function findParticipants(current, depth = 0) { if (depth > 7) return; if (typeof current !== "object" || current === null || current === window) return; const descriptors = Object.getOwnPropertyDescriptors(current); for (const prop in descriptors) { if (prop.startsWith('["spaces/')) return Object.values(current); const item = findParticipants(descriptors[prop].value, depth + 1); if (item !== undefined) return item; } } const rootState = Object.entries(window).find(x => x[0].startsWith("closure_lm_"))[1], participants = findParticipants(rootState), names = []; function findName(obj) { for (const prop in obj) { const value = obj[prop]; if (typeof value === "object" && value !== null && typeof value[1] === "string") return value[1]; } } for (let i = 0; i < participants.length; i++) { const name = findName(participants[i]); if (names.indexOf(name) === -1) names.
@dobesv
dobesv / machine.js
Last active September 28, 2021 00:31
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
{
"compatibility": {
"yarn": "2.x"
},
"extends": ["config:base", ":prHourlyLimit1", "docker:enableMajor"],
"packageFiles": ["package.json"],
"packageRules": [
{
"packageNames": ["aws-sdk"],
"prPriority": 0,
---
# Source: kubedb-catalog/templates/elasticsearch/elasticsearch-psp.yaml
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: elasticsearch-db
labels:
helm.sh/chart: kubedb-catalog-v0.15.1
app.kubernetes.io/name: kubedb-catalog
app.kubernetes.io/instance: kubedb-catalog
@dobesv
dobesv / custom-metrics-apiserver-tls-keys.certificate.yaml
Created November 3, 2020 06:39
prometheus custom metrics server kubernetes resource yamls
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: custom-metrics-apiserver-tls-keys
labels:
app: prometheus-custom-metrics
namespace: prometheus
spec:
secretName: custom-metrics-apiserver-tls-keys
commonName: custom-metrics-apiserver.prometheus.svc
FROM zookeeper:3.5.6
# Disable Java's built-in DNS cache
RUN sed -i 's/#networkaddress\.cache\.ttl=-1$/networkaddress.cache.ttl=0/' "${JAVA_HOME}/lib/security/java.security"
# Enable prometheus stats export
COPY zookeeper-jmx-exporter-rules.yaml /opt/jmx-exporter/zookeeper-jmx-exporter-rules.yaml
RUN mkdir -p /opt/jmx-exporter && wget -O /opt/jmx-exporter/jmx-exporter.jar "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.12.0/jmx_prometheus_javaagent-0.12.0.jar"
ENV SERVER_JVMFLAGS -javaagent:/opt/jmx-exporter/jmx-exporter.jar=9101:/opt/jmx-exporter/zookeeper-jmx-exporter-rules.yaml