Skip to content

Instantly share code, notes, and snippets.

@sgnl
sgnl / README.md
Last active June 21, 2025 08:30
Telegraf MySQL Plugin Installation Guide

Overview

The [MySQL Input Plugin][8] for Telegraf gathers data from a MySQL server.

Setup

Create user for the Telegraf agent to connect with

For connections that are local to the MySQL server, use localhost as your hostname:

#!/bin/sh
# digital-ocean user-data-file to convert debian into alpine
# doctl -v compute droplet create --image debian-11-x64 --region blr1 --size s-1vcpu-1gb-amd --enable-ipv6 --enable-private-networking --droplet-agent=false --ssh-keys 33324601 --user-data-file do-alpine.sh doblr1
# ssh techops@<droplet-ip>
if [ "$(id -u)" -ne "0" ]; then
echo "do-alpine: script must be run as root" >&2
exit 1
fi
@nishantwrp
nishantwrp / lvim-cursor-fix.md
Created February 18, 2023 20:24
Fixing cursor change in lunar vim

Problem

Entering lunarvim changes the default cursor type of terminal.

Solution:

Add the following lines to your config.lua

lvim.autocommands = {
  {
 "VimLeave",
@Orangera1n
Orangera1n / Windows build repo.md
Last active April 26, 2025 11:47
Orangera1n's Windows Build Repo

Notice:

This project is being formally deprecated (informally, it was a while ago) as of today due to various factors:

  • builds being corrupted, likely due to rclone vfs cache mounts messing with them, and due to the nature of onedrive, there being no way to collect hashes in bulk without ugly hacks
  • me being busy and lack of time to work on this often
  • onedrive being a pain to download from
  • having to split shit accorss many accounts, making management painful
  • less control
  • me getting a new ISP thats fast enough for hosting this on a proper server (with dedup) (about that: join here for updates: https://discord.gg/rFNeu7ZyQ2)
@craiglabenz
craiglabenz / chat_message_render_box.dart
Last active June 21, 2025 08:22
Demonstrates a custom RenderObject that draws chat messages like WhatsApp, where the `sentAt` timestamp is tucked into the last line if it fits
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@t3dotgg
t3dotgg / try-catch.ts
Last active June 21, 2025 08:20
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@yisibl
yisibl / git-branch.md
Last active June 21, 2025 08:20
在Mac、Linux 终端显示 Git 当前所在分支

在Mac、Linux 终端显示 Git 当前所在分支

  1. 进入你的home目录
cd ~
  1. 编辑.bashrc文件
@mitchgu
mitchgu / vc707.xdc
Created March 4, 2017 17:36
VC707 XDC Constraints File: Sorted
################################################################################
# VC707 Constraints File
# Sorted (except for FMC, fuck FMC) and human readable
# Author: Mitchell Gu
################################################################################
################################################################################
# CLOCKS
################################################################################
@kmorrill
kmorrill / OP-XY JS Library
Last active June 21, 2025 08:09
OP-XY Midi Controller
<!DOCTYPE html>
<html>
<head>
<title>OP-XY MIDI Control</title>
</head>
<body>
<div id="status"></div>
<button onclick="opxy.start()">Start</button>
<button onclick="opxy.stop()">Stop</button>