Skip to content

Instantly share code, notes, and snippets.

View gcavanunez's full-sized avatar

Guillermo Antony Cava Nuñez gcavanunez

View GitHub Profile
@jesseleite
jesseleite / toggle_surrounding_quote_style.lua
Created December 21, 2023 04:53
Toggle surrounding quote style mapping in Neovim (probably not perfect lol!)
local toggle_surrounding_quote_style = function ()
local current_line = vim.fn.line('.')
local next_single_quote = vim.fn.searchpos("'", 'cn')
local next_double_quote = vim.fn.searchpos('"', 'cn')
if next_single_quote[1] ~= current_line then
next_single_quote = false
end
if next_double_quote[1] ~= current_line then
@proteye
proteye / KeystoneImageUploader.tsx
Last active August 15, 2024 22:19
Image uploading in KeystoneJS document editor
/** @jsxRuntime classic */
/** @jsx jsx */
import { jsx } from '@keystone-ui/core'
import { FC } from 'react'
import styles from './styles'
import { IImageUploaderProps } from './types'
import useBase from './useBase'
export const ImageUploader: FC<IImageUploaderProps> = (props) => {

If you use a ecosystem file, add the following lines to your app:

      interpreter: '/home/forge/.fnm/fnm',
      interpreter_args: 'exec --using=14 node',

14 is the node version. You can be more specific like --using=12.22.4

Example configuration:

@wobsoriano
wobsoriano / DialogProvider.vue
Last active December 19, 2024 13:25
Vuetify + Composition API Dialog component that can be used globally
<template>
<div v-frag>
<slot />
<v-dialog
v-model="isOpen"
:max-width="options.width"
:persistent="options.persistent"
>
<v-card>
<v-card-title>{{ title }}</v-card-title>
@itsMapleLeaf
itsMapleLeaf / README.md
Last active May 24, 2024 03:53
Typed remix helpers

This is no longer needed! Remix's built-in types have improved significantly. But I'll keep this here for historical reasons.


Typed helpers for low-boilerplate type inference with Remix data.

  • I suffix them with *Typed so I don't accidentally import the core remix helpers.
  • This doesn't support regular Response objects to prevent accidentally using them with the typed helpers.
@vivgui
vivgui / bigger-tailwindcss-spacing-scale.js
Last active August 28, 2023 21:55
Here's a bigger spacing scale for TailwindCSS.
spacing: {
"13": '3.25rem',
"15": '3.75rem',
"17": '4.25rem',
"18": '4.5rem',
"19": '4.75rem',
"76": "19rem",
"84": "21rem",
"88": "22rem",
"92": "23rem",
@acidjazz
acidjazz / tw-skeleton.css
Last active October 28, 2022 10:05
tailwind skeleton css
.skeleton {
--text-opacity: 0;
background-image: linear-gradient(100deg, #edf2f7 0%, #f4f7fa 20%, #edf2f7 40%);
background-position: 50%;
background-size: 200%;
animation: skeleton 1.25s infinite linear;
}
.skeleton-teal {
background-image: linear-gradient(100deg, #b4c5f8 0%, #cad8f9 20%, #b4c5f8 40%);
@AlexVanderbist
AlexVanderbist / opendb-ddev.sh
Created September 17, 2020 16:39
opendb for ddev
opendb () {
unset GREP_OPTIONS
PORT="$(ddev describe | ggrep -Pio "(?<=port=)[0-9]*")"
open mysql://db:[email protected]:${PORT}/db
}
@AlexVanderbist
AlexVanderbist / opendb.sh
Created September 17, 2020 16:21
`opendb` command - opens the database for a Laravel app in your GUI
opendb () {
[ ! -f .env ] && { echo "No .env file found."; exit 1; }
DB_CONNECTION=$(grep DB_CONNECTION .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_HOST=$(grep DB_HOST .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PORT=$(grep DB_PORT .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_DATABASE=$(grep DB_DATABASE .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_USERNAME=$(grep DB_USERNAME .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PASSWORD=$(grep DB_PASSWORD .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
@KATT
KATT / favourite-ts-tricks.md
Last active April 8, 2025 01:25
🧙‍♂️ Favourite non-obvious TS tricks

Record<string, x | undefined>

Represent maps

// rather than 
const map: {[ key: string ]: string} = {
  foo: 'bar',
}