Skip to content

Instantly share code, notes, and snippets.

View tjdevries's full-sized avatar
Open Open Source:

TJ DeVries tjdevries

Open Open Source:
View GitHub Profile
local ls = require "luasnip"
vim.snippet.expand = ls.lsp_expand
---@diagnostic disable-next-line: duplicate-set-field = function(filter)
filter = filter or {}
filter.direction = filter.direction or 1
if filter.direction == 1 then
** Conflict (shift/reduce) in state 230.
** Token involved: LPAR
** This state is reached from prog after reading:
varlist1 EQUAL LPAR exp RPAR
** The derivations that appear below have the following common factor:
** (The question mark symbol (?) represents the spot where the derivations begin to differ.)
// TODOs offstream:
// - differences between typedeft shenanigans
// Jokes:
// - mark-and-sweep you off your feet
// For eductional purposes, should we implement
// both a mark-and-sweep, as well as a ref-count?
#include "garbage.h"
tjdevries /
Created August 9, 2023 01:33
hx wrapper lib
open Base
(** Typesafe htmlx wrappers for OCaml. Emits attributes to be used with TyXML *)
(** hx-get [url] *)
let get url = Tyxml.Html.Unsafe.string_attrib "hx-get" url
(** hx-put [url] *)
let put url = Tyxml.Html.Unsafe.string_attrib "hx-put" url
local myfunc = function(opts)
opts = opts or {}
opts.bufnr = opts.bufnr or create_my_buffer(...) = or creat_my_win(...)
-- now do the rest...
tell me about autocommands
Read 11 files
Searched entire codebase for relevant files
(* create a module hiding implementation of what type the ID is and creating ser/de methods *)
module UserID = struct
type t = int
let t =
let encode (t : t) : (int, string) result = Ok t in
let decode (t : int) : (t, string) result = Ok t in
Caqti_type.(custom ~encode ~decode int)
/// Proposed
/// A file which may or may not be async
struct ?async File {
file_descriptor: std::os::RawFd, // shared field in all contexts
async waker: Waker, // field only available in async contexts
!async meta: Metadata, // field only available in non-async contexts
impl ?async File {
use std::env;
use std::fs;
fn main() -> Result<(), std::io::Error> {
let name = env::args().nth(1).expect("to pass an argument");
// Version 1
.flat_map(|x| x.parse::<i32>())
module CoordSet = Set.Make (struct
type t = int * int
let compare =
let part_1 input =
let size = List.hd input |> String.length in
let matrix_n = Array.init size (fun _ -> Array.make size 0) in
let transform_n row col = row, col in