The following snippet contains an example for GoLang Generics for Structs:
package main
import "fmt"
// Structs definition
type ObjectOne struct {
Name string `json:"name"`
-- 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"} -- there is 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 \ |
blueprint: | |
name: Turn on light, switch, scene, script or group based on motion and illuminance. | |
description: > | |
Turn on a light, switch, scene, script or group based on motion detection, and low light level. | |
This blueprint uses helper entities you have to create yourself for some input values, to be able to dynamically set limits. | |
For instructions on creating the helper entities take a look in the Home Assistant Community forum topic: | |
https://community.home-assistant.io/t/turn-on-light-switch-scene-or-script-based-on-motion-and-illuminance-more-conditions/257085 | |
.env
file for me sparing me the need to pollute my session with environment variables.
I've been using Fish shell for years which is great and all, but one thing that has got me frustrated is using it with .env
files.
When attempting to run source .env
in a project, I usually encounter this problem:
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit | |
# Copyright (c) 2021 Marat Reymers | |
## Golden config for golangci-lint v1.61.0 | |
# | |
# This is the best config for golangci-lint based on my experience and opinion. | |
# It is very strict, but not extremely strict. | |
# Feel free to adapt and change it for your needs. | |
run: |