Skip to content

Instantly share code, notes, and snippets.

View lucax88x's full-sized avatar

Luca Trazzi lucax88x

View GitHub Profile
@lucax88x
lucax88x / switch.go
Last active September 18, 2024 15:12
switch ahi ahi
func handler(ctx context) {
dto := "sticazzi"
codeOnFailure := "anchetu"
switch report.Health {
case health.HealthHealthy:
case health.HealthDegraded:
ctx.JSON(http.StatusOK, dto)
case health.HealthUnhealthy:
ctx.JSON(codeOnFailure, dto)
local M = require("lualine.component"):extend()
M.processing = false
M.spinner_index = 1
-- local spinner_symbols = { "▙ ", "▛ ", "▜ ", "▟ " }
local spinner_symbols = {
"⠋",
"⠙",
"⠹",
@lucax88x
lucax88x / neovide.log
Created March 29, 2024 08:25
neovim crash log
TRACE [neovide::window::keyboard_manager] Key pressed l ModifiersState(0x0)
TRACE [neovide::channel_utils] UICommand Serial(Keyboard("l"))
TRACE [neovide::bridge::ui_commands] In Serial Command
TRACE [neovide::bridge::ui_commands] Keyboard Input Sent: l
TRACE [neovide::bridge::handler] Neovim notification: "redraw"
TRACE [neovide::channel_utils] neovim_handler WindowFloatPosition { grid: 146, anchor: NorthEast, anchor_grid: 1, anchor_row: 34.0, anchor_column: 132.0, focusable: true, sort_order: Some(50) }
TRACE [neovide::channel_utils] neovim_handler WindowFloatPosition { grid: 145, anchor: NorthWest, anchor_grid: 2, anchor_row: 0.0, anchor_column: 9.0, focusable: false, sort_order: Some(20) }
TRACE [neovide::channel_utils] neovim_handler WindowFloatPosition { grid: 144, anchor: NorthWest, anchor_grid: 2, anchor_row: 0.0, anchor_column: 0.0, focusable: false, sort_order: Some(20) }
TRACE [neovide::channel_utils] neovim_handler HighlightAttributesDefine { id: 3979, style: Style { colors: Colors { foreground: S
@lucax88x
lucax88x / bug.cs
Last active March 14, 2024 12:49
bug.cs
using System.Data;
using System.Text.Json.Serialization;
using Dapper;
using Newtonsoft.Json;
using Npgsql;
namespace TestProject1;
public class UnitTest1
{
@lucax88x
lucax88x / ruff.logd
Created March 3, 2024 19:45
ruff error
[ERROR][2024-03-03 20:34:30] .../vim/lsp/rpc.lua:794 "rpc" "/Users/luca.trazzi/.local/share/nvim/mason/bin/ruff-lsp" "stderr" "Unable to deserialize message\n + Exception Group Traceback (most recent call last):\n | File \"/Users/luca.trazzi/.local/share/nvim/mason/packages/ruff-lsp/venv/lib/python3.12/site-packages/pygls/protocol/json_rpc.py\", line 330, in _deserialize_message\n | return self._converter.structure(data, request_type)\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n | File \"/Users/luca.trazzi/.local/share/nvim/mason/packages/ruff-lsp/venv/lib/python3.12/site-packages/cattrs/converters.py\", line 332, in structure\n | return self._structure_func.dispatch(cl)(obj, cl)\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n | File \"<cattrs generated structure lsprotocol.types.InitializeRequest>\", line 26, in structure_InitializeRequest\n | if errors: raise __c_cve('While structuring ' + 'InitializeRequest', errors, __cl)\n | ^^^^^^
@lucax88x
lucax88x / filter-nuget.ps1
Created January 29, 2024 17:15
filter-nuget.ps1
function FilterNugetPackages
{
param (
[string[]]$Nugets,
[string]$Include = '',
[string]$Exclude = ''
)
if ($Include -eq "" -and $Exclude -eq "")
{
return $Nugets
@lucax88x
lucax88x / nuget.tests.ps1
Created January 29, 2024 17:14
nuget.tests
if(-not (Get-Module Pester -ListAvailable))
{
Install-Module Pester
}
Import-Module Pester -Passthru
$DebugPreference = "Continue"
Describe 'Nuget' {
@lucax88x
lucax88x / .eslintrc
Created March 17, 2021 14:56
.eslintrc
{
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"airbnb",
/* eslint-disable react/button-has-type */
import { useStyledTheme } from '@pfb/hooks/useTheme';
import { Theme } from '@pfb/models/theme.model';
import {
ButtonHTMLAttributes,
PropsWithChildren,
useCallback,
MouseEvent,
forwardRef,
ReactNode,
import { useCallback, useState } from 'react';
export interface ApiResult<R> {
data: R | null;
isBusy: boolean;
isError: boolean;
isSuccess: boolean;
}
function useCall<D, R>(