The following snippet contains an example for GoLang Generics for Structs:
package main
import "fmt"
// Structs definition
type ObjectOne struct {
Name string `json:"name"`
# ----------------------------------------------------------------------------- | |
# 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() { |
# 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 |
-- 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. |
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"`
# 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) |
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") |
--- BEFORE USING, change language entries to fit your needs. | |
local lspconfig = require'lspconfig' | |
local configs = require'lspconfig/configs' | |
local util = require 'lspconfig/util' | |
local Dictionary_file = { | |
["pt-BR"] = {vim.fn.getenv("NVIM_HOME") .. "spell/dictionary.txt"} -- is there another way to find ~/.config/nvim ? | |
} | |
local DisabledRules_file = { |
FROM ruby:3.0-alpine | |
RUN apk add --no-cache --update \ | |
ack \ | |
bash \ | |
build-base \ | |
curl \ | |
git \ | |
htop \ | |
less \ |