Skip to content

Instantly share code, notes, and snippets.

View tjdevries's full-sized avatar
🏠
Open Open Source: https://www.twitch.tv/teej_dv

TJ DeVries tjdevries

🏠
Open Open Source: https://www.twitch.tv/teej_dv
View GitHub Profile
local lua_dirs = vim.fn.glob("./lua/*", 0, 1)
for _, dir in ipairs(lua_dirs) do
dir = string.gsub(dir, "./lua/", "")
require("plenary.reload").reload_module(dir)
end
func TestNoProjects(t *testing.T) {
db := Setup(t)
pr := &GormProjectRepository{DB: db}
// Don't add any projects
// Test
allProjects := GetProjects(pr)
if len(allProjects) > 0 {
t.Errorf("Shouldn't have any projects, but got: %+v\n", allProjects)
port module Main exposing (..)
import Browser
import Html exposing (Html, button, div, h1, input, li, text, ul)
import Html.Attributes exposing (placeholder, type_, value)
import Html.Events exposing (on, onClick, onInput)
import Json.Decode as D
import Json.Decode exposing (Decoder, field, int, string, andThen, fail, succeed)
local name = "cmp"
local find_module = function(name)
local loaders = package.loaders
for idx, loader in ipairs(package.loaders) do
local l = loader(name)
if type(l) == "function" then
local info = debug.getinfo(l)
print("Source File:", info.source)
end
from collections import Counter
class Solution:
def solve(self, nums):
c = Counter(nums)
for k, v in c.items():
if k == v:
return True
return False
package main
import "fmt"
func main() {
fmt.Println("Part 1:", plzNo())
fmt.Println("Part 2:", plzNo2())
fmt.Println("Part 3:", plzNo3())
fmt.Println("Part 4:", plzNo4())
}
local sorter = require("telescope").extensions.fzf.native_fzf_sorter()
-- Save original scoring function to get the score
local fzf_scoring_function = sorter.scoring_function
-- Override function to do whatever you want.
-- Telescope is just functions
sorter.scoring_function = function(self, prompt, line)
local score = fzf_scoring_function(self, prompt, line)
local json = require "json"
local path = require "path"
local patterns = require "sg.patterns"
local recognizers = require "sg.recognizers"
local shared = loadfile "shared.lua"()
local util = loadfile "util.lua"()
local indexer = "sourcegraph/scip-typescript:autoindex"
local typescript_nmusl_command =
@tjdevries
tjdevries / cfilter.lua
Created September 29, 2022 03:12
cfilter.vim -> cfilter.lua
-- vim9script
-- # cfilter.vim: Plugin to filter entries from a quickfix/location list
-- # Last Change: Jun 30, 2022
-- # Maintainer: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
-- # Version: 2.0
-- #
-- # Commands to filter the quickfix list:
-- # :Cfilter[!] /{pat}/
-- # Create a new quickfix list from entries matching {pat} in the current
-- # quickfix list. Both the file name and the text of the entries are