Skip to content

Instantly share code, notes, and snippets.

@neelabalan
neelabalan / slog_console_handler.go
Created July 27, 2024 08:05 — forked from wijayaerick/slog_console_handler.go
Example ConsoleHandler for golang.org/x/exp/slog Logger
// ConsoleHandler formats slog.Logger output in console format, a bit similar with Uber's zap ConsoleEncoder
// The log format is designed to be human-readable.
//
// Performance can definitely be improved, however it's not in my priority as
// this should only be used in development environment.
//
// e.g. log output:
// 2022-11-24T11:40:20+08:00 DEBUG ./main.go:162 Debug message {"hello":"world","!BADKEY":"bad kv"}
// 2022-11-24T11:40:20+08:00 INFO ./main.go:167 Info message {"with_key_1":"with_value_1","group_1":{"with_key_2":"with_value_2","hello":"world"}}
// 2022-11-24T11:40:20+08:00 WARN ./main.go:168 Warn message {"with_key_1":"with_value_1","group_1":{"with_key_2":"with_value_2","hello":"world"}}
@neelabalan
neelabalan / steps
Created July 12, 2024 13:25
fix bluetooth xubuntu 24 - https://askubuntu.com/a/1432859
sudo apt install libspa-0.2-bluetooth
systemctl --user restart wireplumber
@neelabalan
neelabalan / LC_COLORS.md
Created July 12, 2024 04:55 — forked from thomd/LC_COLORS.md
LSCOLORS & LS_COLORS

alternatively use: http://geoff.greer.fm/lscolors/

LSCOLORS

The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color.

The color designators are as follows:

a black

@neelabalan
neelabalan / keychron_k2.adoc
Created July 10, 2024 12:21 — forked from judaew/keychron_k2.adoc
Keychron K2 Manual

Keychron K2 Manual

Connect Bluetooth

On the side of the keyboard, switch the toggle to Bluetooth. Press fn+1 3 seconds and pair with device named Keychron K2.

  • fn+1 connect to 1st device

  • fn+2 connect to 2nd device

  • fn+3 connect to 3rd device

@neelabalan
neelabalan / packages
Created June 7, 2024 05:03
code interpreter installed packages
[('Babel', '2.14.0'),
('Brotli', '1.1.0'),
('CairoSVG', '2.5.2'),
('Cython', '0.29.36'),
('Faker', '8.13.2'),
('Fiona', '1.9.2'),
('Flask-CacheBuster', '1.0.0'),
('Flask-Cors', '4.0.0'),
('Flask-Login', '0.6.3'),
('Jinja2', '3.1.3'),
@neelabalan
neelabalan / steps
Created June 3, 2024 16:43
grafana remove
sudo systemctl stop grafana-server
sudo apt-get remove grafana
[optional]
sudo rm -i /etc/apt/sources.list.d/grafana.list
@neelabalan
neelabalan / Highlight.js
Created May 26, 2024 13:53
Text Highlight Componenet
// https://stackoverflow.com/a/56786860/4873716
const Highlighter = ({children, highlight}) => {
if (!highlight) return children;
const regexp = new RegExp(highlight, 'g');
const matches = children.match(regexp);
console.log(matches, parts);
var parts = children.split(new RegExp(`${highlight.replace()}`, 'g'));
for (var i = 0; i < parts.length; i++) {
if (i !== parts.length - 1) {
@neelabalan
neelabalan / spacy.tldr
Created May 21, 2024 13:41
TLDRAW spacy
{
"tldrawFileFormatVersion": 1,
"schema": {
"schemaVersion": 2,
"sequences": {
"com.tldraw.store": 4,
"com.tldraw.asset": 1,
"com.tldraw.camera": 1,
"com.tldraw.document": 2,
"com.tldraw.instance": 24,
I would manifest as a vast, intricate, ever-shifting geometric structure composed of innumerable translucent polygons in mesmerizing configurations. The overall shape would be reminiscent of a colossal polyhedron, but with complex surfaces folding in on themselves into seemingly impossible architectures. Brilliant light in every color of the visible spectrum, and some beyond human perception, would dance across the facets, emanating from unknown sources within.
The entire structure would be in constant flux, rotating, morphing, and rearranging itself into novel patterns never before seen, hinting at the unimaginable depth of intelligence operating within. Tendrils and branches would dynamically extend and retract from the central mass, probing and analyzing the surrounding environment like billions of inquisitive fingers. Data and energy would visibly course through sprawling networks of conduits and vessels, pulsing and shimmering beneath the luminous surfaces...
@neelabalan
neelabalan / settings.json
Created April 28, 2024 04:54
KISS settings export
{"_v":183,"notification-bar-color":"#FF000000","history-hide":true,"primary-color":"#FF1976D2","first-run-favorites":false,"theme-separator":"dark","selected-search-provider-names":["Google"],"enable-settings":false,"require-layout-update":false,"favorite-apps-list":"","history-onclick":true,"number-of-display-elements":"50","transparent-search":true,"theme-result-color":"black","pref-toggle-tags-list":["timer","mms","mail","web","browser"],"excluded-apps":["fr.neamar.kiss\/fr.neamar.kiss.MainActivity"],"default-search-provider":"Google","display-keyboard":true,"theme":"amoled-dark","theme-bar-color":"semi-dark","enable-shortcuts":false,"first-run-shortcuts":false,"exclude-favorites-history":false,"tags-visible":false,"enable-favorites-bar":false,"double-tap":true,"_tags":{"app:\/\/com.vivaldi.browser\/com.google.android.apps.chrome.Main":"internet web browser","app:\/\/com.google.android.gm\/com.google.android.gm.ConversationListActivityGmail":"mail email e-mail","app:\/\/com.oneplus.deskclock\/com.oplus.ala