Skip to content

Instantly share code, notes, and snippets.

View akinsho's full-sized avatar

Akin akinsho

  • London
View GitHub Profile
@mactep
mactep / conceal.lua
Last active June 7, 2025 10:59
Conceal html class attribute values using treesitter
-- THIS IS DEPRECATED, USE THE FILE BELOW
-- should get bufnr from autocmd or something
-- conceal only accepts one character
-- thanks to u/Rafat913 for many suggestions and tips
local namespace = vim.api.nvim_create_namespace("class_conceal")
local group = vim.api.nvim_create_augroup("class_conceal", { clear = true })
local conceal_html_class = function(bufnr)
@folke
folke / lua-lsp.lua
Last active March 7, 2023 19:17
Correct sumneko lua lsp setup for init.lua and plugin development
-- put this file somewhere in your nvim config, like: ~/.config/nvim/lua/config/lua-lsp.lua
-- usage: require'lspconfig'.sumneko_lua.setup(require("config.lua-lsp"))
local library = {}
local path = vim.split(package.path, ";")
-- this is the ONLY correct way to setup your path
table.insert(path, "lua/?.lua")
table.insert(path, "lua/?/init.lua")
@0x6a68
0x6a68 / .projections.json
Created November 26, 2020 09:02
vim-projectionist: typescript + react
{
"*.tsx": {
"alternate": "{dirname}/__tests__/{basename}.test.tsx",
"type": "source",
"template": [
"import type {open} FC {close} from 'react';",
"",
"type {basename|camelcase|capitalize}Props = {open}",
" property?: unknown;",
"{close};",

Some useful custom text objects for vim

Collection of my custom text objects I use quite often.

97975602 6e90ee00 1dda 11eb 9286 6894300457e3

Numbers

Put it into your .vimrc:

@vinicioslc
vinicioslc / flutter-android-cd.yml
Last active November 20, 2024 15:53
Build flutter releases in github actions for production only android for while.
# This is a basic workflow to help you get started with Actions
name: CD Internal-Lane
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
tags:
- "internal-v*.*.*" # on every version tag will build a new android artifact example: v3.1.2+6
jobs:
@Meorawr
Meorawr / async.lua
Last active September 8, 2024 20:17
Lua 5.1 Async/Await
#!/usr/bin/lua5.1
--- Async/Await for Lua 5.1
-- This script implements async/await functions for Lua, allowing tasks to
-- be queued and scheduled independently.
--
-- This is just an example and has a bunch of issues, isn't tested, isn't
-- even actually used anywhere; I basically just got bored and had one of
-- those "what if?" type ideas 6 hours ago.
local co_create = coroutine.create
@romkatv
romkatv / two-line-prompt.zsh
Last active October 9, 2025 19:24
Two-line ZSH prompt
# Example of two-line ZSH prompt with four components.
#
# top-left top-right
# bottom-left bottom-right
#
# Components can be customized by editing set-prompt function.
#
# Installation:
#
# (cd && curl -fsSLO https://gist.github.com/romkatv/2a107ef9314f0d5f76563725b42f7cab/raw/two-line-prompt.zsh)
@miquelbeltran
miquelbeltran / pre-push
Created June 4, 2019 07:18
Flutter pre-push hook that runs analyze and test
#!/bin/sh
# To use add to `.git/hooks/`
# Should be named `pre-push`
# Make executable with `chmod +x`
# stash any unstaged changes
git stash -q --keep-index
# run Flutter analyze + test
flutter analyze
@romainl
romainl / align.vim
Last active August 4, 2023 07:45
Ultra lightweight aligning
" Use a bunch of standard UNIX commands for quick an dirty
" whitespace-based alignment
function! Align()
'<,'>!column -t|sed 's/ \(\S\)/ \1/g'
normal gv=
endfunction
xnoremap <silent> <key> :<C-u>silent call Align()<CR>