Skip to content

Instantly share code, notes, and snippets.

View corasaurus-hex's full-sized avatar

Cora Sutton corasaurus-hex

View GitHub Profile
@khalidx
khalidx / node-typescript-esm.md
Last active May 8, 2024 07:58
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

(defn send-repl [& [obj]]
(let [in-in (java.io.PipedInputStream.)
in-out (java.io.PipedOutputStream. in-in)
out-in (java.io.PipedInputStream.)
out-out (java.io.PipedOutputStream. out-in)
err-in (java.io.PipedInputStream.)
err-out (java.io.PipedOutputStream. err-in)]
(tap> {:repl/in (clojure.java.io/writer in-out)
:repl/out (clojure.java.io/reader out-in)
(defonce ^Logger logger (doto (Logger/getLogger "clojure")
(.setUseParentHandlers false)
(.addHandler
(doto (ConsoleHandler.)
(.setLevel Level/ALL)
(.setFormatter
(proxy [SimpleFormatter] []
(format [^LogRecord record]
(let [sb (StringBuilder.)]
(.append sb "#:log{")
@cellularmitosis
cellularmitosis / Makefile
Last active August 5, 2020 00:19
Trivial Janet project with a bundled native C module
default: test-foo test-baz
build/foo.a: foo.c
jpm --verbose build
test-foo: build/foo.a
test 42 = $(shell janet -e '(import build/foo :as foo) (print (foo/bar))')
repl-foo: build/foo.a
janet -e '(import build/foo :as foo)' -r
@cellularmitosis
cellularmitosis / README.md
Last active August 10, 2020 19:14
Janet 1.10.1 Stdlib, organized by topic
@sogaiu
sogaiu / peg-exercises.janet
Last active November 11, 2022 00:27
janet peg exercises
# find * and + to be confusing, trying to use sequence and choice instead
(def peg-simple
~{:main (capture (some :S))})
(peg/match peg-simple "hello") # => @["hello"]
# from:
# https://janet-lang.org/docs/peg.html
(defn finder
@kiennq
kiennq / build_emacs.sh
Last active January 29, 2023 20:32
Build emacs-snapshot on Ubuntu 18.04
git clone --single-branch --depth=1 https://github.com/emacs-mirror/emacs.git
cd emacs/
sudo apt install -y autoconf make gcc texinfo libxpm-dev \
libjpeg-dev libgif-dev libtiff-dev libpng-dev libgnutls28-dev \
libncurses5-dev libjansson-dev libharfbuzz-dev
./autogen.sh
./configure --with-json --with-modules --with-harfbuzz --with-compress-install \
--with-threads --with-included-regex --with-zlib --with-cairo --without-rsvg\
--without-sound --without-imagemagick --without-toolkit-scroll-bars \
--without-gpm --without-dbus --without-makeinfo --without-pop \
@fnky
fnky / ANSI.md
Last active May 12, 2024 06:46
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@melotusme
melotusme / one-liners.md
Created March 29, 2018 03:59 — forked from KL-7/one-liners.md
Ruby one-liners

One-liners

Reverse every line:

Input file:

$ cat foo
qwe
123

bar

@maxim
maxim / docker-compose.yml
Created August 7, 2017 23:07
Getting started with docker
version: '3'
services:
postgres:
image: postgres:9.6
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data