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 { createSolidTable, flexRender, getCoreRowModel, getPaginationRowModel } from "@tanstack/solid-table"; | |
import type { HeaderGroup, Row, RowData, TableOptions, Table as TanTable } from "@tanstack/solid-table"; | |
import { createMemo, For, Match, type Resource, Show, splitProps, Switch } from "solid-js"; | |
import Paging from "./table/paging"; | |
import ArchiveBox from "~/assets/archiveBox.svg"; | |
import lists from "~/lib/lists"; | |
export type TableProps<T = any> = Omit<TableOptions<T>, "data" | "getCoreRowModel"> & { | |
data: Resource<T[]> | |
emptyDataMessage?: string |
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
declare var grecaptcha: { | |
ready: (callback: () => void) => void; | |
execute: (siteKey: string, opts: { action: "submit" }) => Promise<string>; | |
}; | |
export type CodeFunction = () => Promise<string>; | |
export default function(setter: (fn: CodeFunction) => void) { | |
const siteKey = import.meta.env.VITE_CAPTCHA_SITE_KEY; |
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 ( | |
"testing" | |
"github.com/brianvoe/gofakeit/v6" | |
"github.com/gofiber/fiber/v2" | |
"github.com/stretchr/testify/assert" | |
"golang.org/x/net/context" | |
"github.com/kkharji/boonize/database" | |
"github.com/kkharji/boonize/lib/httpserver" |
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 (d *DNSResolver) handlePacket(pc net.PacketConn, addr net.Addr, payload []byte) error { | |
var parser dnsm.Parser | |
log := d.log.Named("handlePacket") | |
header, err := parser.Start(payload) | |
if err != nil { | |
return fmt.Errorf("start parsing payload: %w", err) | |
} | |
question, err := parser.Question() |
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 to provide advanced error type with the purpose of making errors | |
// easy to read and trace, construct and pass, wrap and extend and more. | |
package errx | |
import ( | |
"errors" | |
"fmt" | |
"github.com/gofiber/fiber/v2" | |
"go.uber.org/zap/zapcore" |
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
pub fn create_query_table<'lua>( | |
lua: &'lua Lua, | |
scope: &str, | |
socket_path: &str, | |
) -> LuaResult<LuaTable<'lua>> { | |
let scope_with_dashes = format!("--{scope}"); | |
let query_all = vec!["query".to_owned(), scope_with_dashes.clone()]; | |
let mut scope_singler = scope_with_dashes; | |
let mut query_single = query_all.clone(); |
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
let | |
mkConfig = { config, lib, ... }: | |
with lib; | |
{ | |
config = { | |
home.activation.manualLinkOfFiles = | |
let | |
createLink = t: o: '' | |
ORIGIN="${config.toFullLink o}" | |
TARGET="$HOME/${t}" |
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
use ignore::{types::Types, Walk, WalkBuilder}; | |
fn get_results(home: &String, paths: &mut Vec<String>) -> Vec<String> { | |
let mut walker = WalkBuilder::new(paths.pop().unwrap()); | |
for root in paths { | |
walker.add(root); | |
} | |
let mut results = vec![]; |
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
{ lib, ... }: | |
let | |
inherit (builtins) fromJSON readFile; | |
inherit (lib) mapAttrsToList strings concatStringsSep replaceStrings; | |
inherit (strings) stringToCharacters head; | |
# Read definitions to a list of definitions | |
defs = let | |
# Path to definitions | |
source = ../../config/nvim/snippets/gitcommit.json; |