Skip to content

Instantly share code, notes, and snippets.

@ohbob
ohbob / logging-grafana-loki.md
Created August 30, 2025 10:31 — forked from thezawzaw/logging-grafana-loki.md
Centralized Logging with Grafana Loki and Promtail

Centralized Logging Setup with Grafana Promtail and Loki

This page describes how to setup Grafana Promtail and Loki for sending the contents of local logs to the centralized Grafana Loki server or Grafana Cloud.

Prerequisties

  • Docker Engine
  • Docker Compose

Setup Grafana Loki

@ohbob
ohbob / settings.json
Created June 7, 2024 20:37 — forked from MiraiSubject/settings.json
Svelte custom label
{
"workbench.editor.customLabels.patterns": {
"**/src/routes/+page.svelte": "Root Page",
"**/src/routes/+layout.svelte": "Root Layout",
"**/src/routes/+page.ts": "Root Page Data (Universal)",
"**/src/routes/+page.server.ts": "Root Page Data (Server)",
"**/src/routes/+layout.server.ts": "Root Layout Data (Server)",
"**/src/routes/+layout.ts": "Root Layout Data (Universal)",
"**/src/routes/*/**/+page.svelte": "${dirname} - Page",
"**/src/routes/*/**/+layout.svelte": "${dirname} - Layout",
@ohbob
ohbob / gist:dd566d60bd82fe51781b83de5b69cb23
Created May 25, 2021 05:48 — forked from dipaksaraf/gist:c18a5d15b87f97f9a07af5e6d2449ff5
How to Use AVIF: The New Next-Gen Image Compression Format in WordPress
function cmyee_allowed_mime_types( $mime_types ) {
//AVIF Images
$mime_types['avif'] = 'image/avif';
return $mime_types;
}
add_filter( 'upload_mimes', 'cmyee_allowed_mime_types', 1, 1 );
@ohbob
ohbob / httpStore.js
Created January 24, 2021 00:15 — forked from joshnuss/httpStore.js
A Svelte store backed by HTTP
import { writable } from 'svelte/store'
// returns a store with HTTP access functions for get, post, patch, delete
// anytime an HTTP request is made, the store is updated and all subscribers are notified.
export default function(initial) {
// create the underlying store
const store = writable(initial)
// define a request function that will do `fetch` and update store when request finishes
store.request = async (method, url, params=null) => {