Skip to content

Instantly share code, notes, and snippets.

@FUSAKLA
FUSAKLA / debugging-slow-grafana-dashboard.md
Last active April 25, 2024 12:45
Speeding up Grafana dashboard

Intro

So your dashboard is slow? We are doing our best but maybe it's time to think if the issue isn't on your side.

Some of our dashboards looks like https://www.theworldsworstwebsiteever.com/. Are you sure you really need to see all the time all the data? Or do you really need to see data for last week or month all the time? How often do you use filtering by some of those variables in your dashboard?

Let's not end up as your mother saying:

But.. but.. I might need this in future so let's leave this icon on the Desktop.

@Shubhra22
Shubhra22 / ScreenshotNow.cs
Last active April 25, 2024 12:45
Screen Capture of particular UI elements
using UnityEngine;
using System.Collections;
using System.IO;
using UnityEngine.UI;
public class ScreenshotNow : MonoBehaviour
{
public RectTransform rectT; // Assign the UI element which you wanna capture
public Image img;
int width; // width of the object to capture
int height; // height of the object to capture
private val DefaultHighlightWidth = 136.dp
private val DefaultDuration = 1200.milliseconds
private val DefaultDelay = 1.seconds
private val DefaultStartColor = Color(0x32394A00)
private val DefaultMiddleColor = Color.White
private val DefaultEndColor = DefaultStartColor
private const val DefaultAlpha = 0.2F
private val DefaultShape = RoundedCornerShape(12.dp)
@Composable
@KlassenKonstantin
KlassenKonstantin / RubberBandSlider.kt
Created January 15, 2024 17:16
Rubber Band Slider Compose
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
setContent {
RubberBandSliderTheme {
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) {
Box(contentAlignment = Alignment.Center) {
RubberBandSlider(modifier = Modifier
.height(200.dp)
@bennewton999
bennewton999 / dailyNoteTemplate.txt
Last active April 25, 2024 12:40
My current Daily Note Template in Obsidian utilizing Templater and DataView Plugins
---
creation date: <% tp.file.creation_date() %>
tags: DailyNote <% tp.file.title.split('-')[0] %>
---
modification date: <%+ tp.file.last_modified_date("dddd Do MMMM YYYY HH:mm:ss") %> // This doesn't currently work in front matter, hoping that gets fixed.
# <% tp.file.title %>
<< [[<% tp.date.now("YYYY-MM-DD", -1, tp.file.title, "YYYY-MM-DD") %>]] | [[<% tp.date.now("YYYY-MM-DD", 1, tp.file.title, "YYYY-MM-DD") %>]]>>
@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@ruvnet
ruvnet / Readme.md
Created April 25, 2024 12:17
Deploying LLaMA 3 70B with AirLLM and Gradio on Hugging Face Spaces

Deploying LLaMA 3 70B with AirLLM and Gradio on Hugging Face Spaces

This tutorial guides you through the process of deploying a Gradio app with the LLaMA 3 70B language model using AirLLM on Hugging Face Spaces. The app provides a user-friendly interface for generating text based on user prompts.

Overview

  • LLaMA 3 70B: A large language model developed by Meta AI with 70 billion parameters, capable of generating coherent and contextually relevant text.
  • AirLLM: A Python library that enables running large language models like LLaMA on consumer hardware with limited GPU memory by using layer-by-layer inferencing.
  • Gradio: A Python library for quickly creating web interfaces for machine learning models, allowing users to interact with the models through a user-friendly UI.
  • Hugging Face Spaces: A platform for hosting and sharing machine learning demos, allowing easy deployment and access to Gradio apps.
@davidsklar
davidsklar / fix-broken-utf-8.php
Created August 25, 2015 17:23
Fixing Broken UTF-8
<?php
function fixBrokenUTF8($contents) {
static $replacement = chr(0xEF) . chr(0xBF) . chr(0xBD);
$expectingNewChar = true;
$expectedLength = 0;
$expectedIndex = 0;
$i = 0;
$out = "";
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 25, 2024 12:35
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.