Skip to content

Instantly share code, notes, and snippets.

@kerituni12
kerituni12 / gacode-example-gtag-js.html
Created January 17, 2023 07:03 — forked from mbaersch/gacode-example-gtag-js.html
Write Google Analytics Client ID to localStorage
<!--
Replace existing standard gtag.js tracking-code with this
snippet in order to store the Client ID in localStorage and use this ID when present
converted for direct code implementation from Simo Ahava´s solution for GTM; see
https://www.simoahava.com/analytics/use-localstorage-client-id-persistence-google-analytics/
for details
Client IDs will survive deletion of cookies by user or ITP 2.1
@kerituni12
kerituni12 / mongo-statefulset.yaml
Created August 9, 2022 15:31 — forked from thilinapiy/mongo-statefulset.yaml
MongoDB statefulset for kubernetes with authentication and replication
## Generate a key
# openssl rand -base64 741 > mongodb-keyfile
## Create k8s secrets
# kubectl create secret generic mongo-key --from-file=mongodb-keyfile
---
apiVersion: v1
kind: Service
metadata:
name: mongo
labels:
@kerituni12
kerituni12 / docker-cleanup-resources.md
Created August 8, 2022 09:11 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@kerituni12
kerituni12 / rgbaToHex.js
Created July 18, 2022 10:25 — forked from whitlockjc/rgbaToHex.js
Use JavaScript to Convert RGBA CSS Value to Hexadecimal
#!/usr/bin/env node
// Takes an rgba() CSS value and converts it to its 8 digit hexadecimal value.
//
// Usage: ./rgbaToHex.js "{YOUR_RGBA_STRING}"
//
// Example: ./rgbaToHex.js "rgba(197, 200, 198, .2)" => #C5C8C633
function trim (str) {
return str.replace(/^\s+|\s+$/gm,'');
@kerituni12
kerituni12 / a-mongodb-replica-set-docker-compose-readme.md
Created June 26, 2022 15:13 — forked from harveyconnor/a-mongodb-replica-set-docker-compose-readme.md
MongoDB Replica Set / docker-compose / mongoose transaction with persistent volume

This will guide you through setting up a replica set in a docker environment using.

  • Docker Compose
  • MongoDB Replica Sets
  • Mongoose
  • Mongoose Transactions

Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!

@kerituni12
kerituni12 / jquery.ui.pagination.js
Created November 10, 2019 08:44 — forked from Alxandr/jquery.ui.pagination.js
Pagination using jquery ui
/*
* jQuery UI Pagination 0.1.0
*
* By Alxandr
*/
(function( $, undefined ) {
var getAllElements = function(elem, excludeFirst) {
var elm = elem.get(0);
if(elm.tagName.toLowerCase() == 'table') {