Skip to content

Instantly share code, notes, and snippets.

View damienstanton's full-sized avatar
🤷

Damien Stanton damienstanton

🤷
  • PwC
  • DC & Baltimore, USA
  • 13:33 (UTC -04:00)
View GitHub Profile
module type TNT = sig
type 'a typed_name
val inj : string -> 'a typed_name
val prj : 'a typed_name -> string
end
module TN : TNT = struct
type 'a typed_name = string
let inj = fun x -> x
let prj = fun x -> x
@wordijp
wordijp / Makefile
Created May 14, 2020 14:48
deno example by Makefile
# https://stackoverflow.com/questions/2483182/recursive-wildcards-in-gnu-make
rwildcard=$(foreach d,$(wildcard $(1:=/*)), \
$(call rwildcard,$d,$2) \
$(filter $(subst *,%,$2),$d))
# http://www.jsk.t.u-tokyo.ac.jp/~k-okada/makefile/
empty:=
space:= $(empty) $(empty)
myjoin=$(subst $(space),$2,$1)
# --------------------------------------------------
LOCAL_ROOT = http://localhost:8000/
@tazjin
tazjin / thoughts.md
Last active February 28, 2024 12:05
Nix builder for Kubernetes
@okkero
okkero / Main.idr
Created December 17, 2017 14:57
Idris-JVM Spigot plugin
module Main
import IdrisJvm.FFI
import IdrisJvm.IO
import Java.Lang
%default total
record Java a ret where
@binshengliu
binshengliu / cornell-note.tex
Created August 15, 2017 15:12
Cornell-note latex template
% https://tex.stackexchange.com/a/273223/124998
\documentclass[a4paper]{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\title{
\vspace{-3em}
\begin{tcolorbox}[colframe=white,opacityback=0]
\begin{tcolorbox}
@karpathy
karpathy / min-char-rnn.py
Last active May 18, 2024 09:02
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@dbuenzli
dbuenzli / gen.ml
Last active June 11, 2022 18:13
OCaml simple generators
(*---------------------------------------------------------------------------
Copyright (c) 2015 Daniel C. Bünzli. All rights reserved.
Distributed under the BSD3 license, see license at the end of the file.
%%NAME%% release %%VERSION%%
---------------------------------------------------------------------------*)
(* Simple generators according to:
Kiselyov, Peyton-Jones, Sabry
Lazy v. Yield: Incremental, Linear Pretty-printing
@Integralist
Integralist / 0. description.md
Last active June 17, 2023 21:49
Clojure deftype, defrecord, defprotocol
  • defprotocol: defines an interface
  • deftype: create a bare-bones object which implements a protocol
  • defrecord: creates an immutable persistent map which implements a protocol

Typically you'll use defrecord (or even a basic map);
unless you need some specific Java inter-op,
where by you'll want to use deftype instead.

Note: defprotocol allows you to add new abstractions in a clean way Rather than (like OOP) having polymorphism on the class itself,

@andrewseidl
andrewseidl / Clang-format Comparison.md
Last active April 10, 2024 04:10
Clang-format style comparison

This is a comparison of the different formatting styles including with clang-format.

Generated via:

styles=( LLVM Google Chromium Mozilla WebKit )
for style in $styles
do
  clang-format -style=$style ChLcpIterativeAPGD.h > ChLcpIterativeAPGD.$style.h

done

@allgress
allgress / reagent_datascript.cljs
Last active February 16, 2023 21:16
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))