Skip to content

Instantly share code, notes, and snippets.

@lierdakil
lierdakil / example.ts
Last active September 19, 2022 13:28
An example of Functor in TypeScript. You can run this on https://www.typescriptlang.org/play/
interface Functor<T> {
map<U>(f: (x: T) => U): Functor<U>
}
class Box<T> implements Functor<T> {
value: T
constructor(x: T) {
this.value = x
}
map<U>(f: (x: T) => U): Box<U> {
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active May 1, 2024 18:18
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@stalniy
stalniy / eslint-pushed-changes.sh
Created October 12, 2016 13:06
ESLINT + pre-receive git hook
#!/bin/bash
TEMPDIR=`mktemp -d`
ESLINTRC=$TEMPDIR/.eslintrc
COMMAND="eslint --color -c $ESLINTRC --rule 'import/no-unresolved: 0' --rule 'import/no-duplicates: 0' --rule 'import/export: 0'"
git show HEAD:.eslintrc > $ESLINTRC
echo "### Ensure changes follow our code style... ####"
# See https://www.kernel.org/pub/software/scm/git/docs/githooks.html#pre-receive
@dlukes
dlukes / emacs_daemon.scpt
Last active December 10, 2018 04:23
AppleScript wrapper app around Emacs for running it conveniently as a daemon on OS X
(* SETUP
1. Create an Application in Automator.
2. Add a Run AppleScript action.
3. Paste the content of this gist instead of the provided script skeleton.
4. Save the app, drag it to your dock and/or set it as the default app for
the filetypes of your choice using the Open With dialog in Finder.
NOTES ON USAGE
@nicferrier
nicferrier / elnode-ijs.el
Last active June 8, 2018 00:05
A complete javascript shell with elnode. It's pretty simple obviously and there's a lot of return value hacking to do. It's quite interesting that this stuff is so easy though. I think it might be a useful addition to any elnode project to map in a handler that let you control the javascript from the elnode emacs instance.
;;; interactive javascript shell with elnode -*- lexical-binding: t -*-
(elnode-app elnode-ijs-dir comint uuid)
(defvar elnode-ijs/input nil
"Input for the js shell.
Each element is a cons of a uuid and the javascript to send.")
(defvar elnode-ijs/input-hash (make-hash-table :test 'equal)