This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [env] | |
| CFLAGS = "-I/opt/homebrew/include" | |
| LDFLAGS = "-L/opt/homebrew/lib" | |
| [settings] | |
| disable_backends = ["dotnet"] | |
| idiomatic_version_file_enable_tools = [] | |
| [settings.pipx] | |
| uvx = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ----------------------------------------------------------------------------- | |
| # AI-powered Git Commit Function | |
| # Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
| # 1) gets the current staged changed diff | |
| # 2) sends them to an LLM to write the git commit message | |
| # 3) allows you to easily accept, edit, regenerate, cancel | |
| # But - just read and edit the code however you like | |
| # the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/ | |
| gcm() { |
- Clone https://github.com/streetsidesoftware/vscode-spell-checker locally and compile it with
npm i && npm run build-production. You can put js build to nvim config dir, so if you are store config in git .js will be always available on all machines. - Create file
lua/cspell-lsp/init.lua. Putmain.cjstolua/cspell-lsp.
local util = require 'lspconfig.util'
-- Function to decode a URI to a file path
local function decode_uri(uri)
return string.gsub(uri, 'file://', '')
end
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # install | |
| pip install shell-gpt | |
| sgpt "hi" (and enter your API key) | |
| # commit the current folder with the generated message | |
| git commit . -m "$(git diff | sgpt --model gpt-4o --code 'Write concise, informative commit messages: Start with a summary in imperative mood, explain the 'why' behind changes, keep the summary under 50 characters, use bullet points for multiple changes, avoid using the word refactor, instead explain what was done, and reference related issues or tickets. What you write will be passed to git commit -m "[message]"')" | |
| # you could assign an alias now if you like it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- https://github.com/jhawthorn/fzy/pull/116#issuecomment-538708329 | |
| local function fzy(a) | |
| local saved_spk = vim.o.splitkeep | |
| local src_winid = vim.fn.win_getid() | |
| -- lines >= 3 is a hardcoded limit in fzy | |
| local fzy_lines = (vim.v.count > 2 and vim.v.count) or 10 | |
| local tempfile = vim.fn.tempname() | |
| local term_cmd = a.input .. ' | fzy -l' .. fzy_lines .. ' > ' .. tempfile | |
| -- FIXME: terminal buffer shows in `:ls!` after exiting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from abc import ABC, abstractmethod | |
| from typing import AsyncIterator, Optional | |
| import uvicorn | |
| from dotenv import load_dotenv | |
| from fastapi import Depends, FastAPI | |
| from fastapi.responses import JSONResponse | |
| from sqlalchemy import select | |
| from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine |
The following snippet contains an example for GoLang Generics for Structs:
package main
import "fmt"
// Structs definition
type ObjectOne struct {
Name string `json:"name"`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort) | |
| fshow() { | |
| local out shas sha q k | |
| while out=$( | |
| git log --graph --color=always \ | |
| --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | | |
| fzf --ansi --multi --no-sort --reverse --query="$q" \ | |
| --print-query --expect=ctrl-d --toggle-sort=\`); do | |
| q=$(head -1 <<< "$out") | |
| k=$(head -2 <<< "$out" | tail -1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set(CMAKE_C_COMPILER clang) | |
| set(CMAKE_CXX_COMPILER clang++) | |
| cmake_minimum_required(VERSION 3.18) | |
| set(APP_NAME "example-app") | |
| project("${APP_NAME}") | |
| set(CMAKE_CXX_STANDARD 20) | |
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++20 -Wno-multichar") |
NewerOlder