Skip to content

Instantly share code, notes, and snippets.

@lucacicada
lucacicada / page.vue
Created March 10, 2025 10:52
Nuxt useFetch extract typings
<script setup lang="ts">
import type { FetchResult } from '#app'
type Data = FetchResult<'/api/something', 'get'>
const { data } = await useFetch('/api/something')
</script>
@lucacicada
lucacicada / README.md
Created February 11, 2025 09:37
Swap Google Search Background color scriptlet

Do not paste code randomly on your browser

We are kinda forced since Google treat us as lab rats

For Brave:

brave://settings/shields/filters

Make sure developer mode is on, add this custom filter:

@lucacicada
lucacicada / tailwind.config.ts
Created May 8, 2024 13:38
Tailwindcss Shadcn Prose
import type { Config } from 'tailwindcss'
import typography from '@tailwindcss/typography'
export default <Partial<Config>>{
theme: {
extend: {
typography: {
DEFAULT: {
css: {
'--tw-prose-body': 'hsl(var(--foreground))',
@lucacicada
lucacicada / decimal-payload.ts
Last active June 6, 2023 20:39
Nuxt v3.5.0 Decimal.js payload plugin
// plugins/decimal-payload.ts
import { Decimal } from 'decimal.js'
export default definePayloadPlugin(() => {
definePayloadReducer('Decimal', data => Decimal.isDecimal(data) && data.toJSON())
definePayloadReviver('Decimal', data => new Decimal(data))
})
@lucacicada
lucacicada / ConsoleEx.cs
Created April 25, 2022 14:12
C# Console concurrent thread-safe write on the same line
namespace System;
using System.Text;
using System.Threading;
public static class ConsoleEx
{
/// <summary>
/// Keep track of concurrent writing.
/// </summary>
@lucacicada
lucacicada / DOM.js
Created April 18, 2022 20:54
Deno JSDOM 19.0.0 port
This file has been truncated, but you can view the full file.