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
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 |
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
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) |
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
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) | |
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
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 |
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
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 | |
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
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()) | |
} |
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
func ThisIsRecommendedButBroken() error { | |
f, err := os.Open("this_file.txt") | |
if err != nil { | |
return err | |
} | |
// Make sure to close this later... | |
defer func() { err = f.Close() }() | |
// do some stuff |
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
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) |
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
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 = |
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
-- 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 |