Skip to content

Instantly share code, notes, and snippets.

macro def {
rule {
$name:ident ( $($params:ident : $type:ident) (,) ...) $body
} => {
// just throwing away the type annotation. The semantics of type
// annotations left as an exercise to the reader :)
function $name ($params (,) ...) $body
}
}
@lukechilds
lukechilds / README.md
Created April 11, 2017 06:09
JavaScript performance testing accurate to 5 microseconds in 59 bytes

Performance testing accurate to 5 microseconds in 57 bytes

Test JavaScript methods against each other accurate to 5 microseconds (five thousandths of a millisecond).

Usage

time = fn=>{let t=()=>performance.now(),s=t();fn();return t()-s}
time(() => document.querySelectorAll('span'))
// 0.18499999959021807
@ChuckM
ChuckM / farewell.md
Last active June 7, 2021 18:21
On my departure (fictional)

Dear non-executive team members,

All of my options have vested, and I haven’t been offered any new ones so my earning potential here is no longer all that great. Worse, as we’ve operated and developed better understandings of the problems we face it seems less likely than ever that we’ll achieve the vision we set out to achieve. Finally, the blackout periods are having a real negative effect on my ability to diversify my wealth and avoid the high risk of this company’s success chances. Therefore I’m leaving on a “high note” while we can still plausibly call this endeavor a success, and after I’ve left will convert all my equity in this venture into other forms of wealth while not having to report it

Building Emacspeak: Making GNU Emacs Accessible

In 2015, I started diving deeper into GNU Emacs because I saw its potential as an assistive technology. Not only as a way of providing better access to books and code for my students and clients, many of whom are blind, but also as a tool for creating more accessible content. Regular expressions and modes like Org, Markdown, and AucTex are extremely useful in the production of alternate formats.

Although I had used Emacs as a vanilla text editor off and on since the 90's, I didn't learn anything about the underlying Emacs Lisp (elisp) programming language until the end of 2015, when I got a hardcopy Emacs manual, quit my day job, and grew t

@kizzx2
kizzx2 / fun.cpp
Created January 11, 2012 14:29
Illustrative C++ Lua binding example/tutorial
// fun.cpp
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <iostream>
@ksopyla
ksopyla / polish_sentence_nltk_tokenizer.py
Last active September 19, 2022 07:29
A curated list of Polish abbreviations for NLTK sentence tokenizer based on Wikipedia text
import nltk
# interactive download
# nltk.download()
nltk.download('punkt')
extra_abbreviations = [
"ps",
"inc",
"corp",
@elnygren
elnygren / expression_problem.clj
Last active December 3, 2022 16:33
Solving the Expression Problem with Clojure
; The Expression Problem and my sources:
; http://stackoverflow.com/questions/3596366/what-is-the-expression-problem
; http://blog.ontoillogical.com/blog/2014/10/18/solving-the-expression-problem-in-clojure/
; http://eli.thegreenplace.net/2016/the-expression-problem-and-its-solutions/
; http://www.ibm.com/developerworks/library/j-clojure-protocols/
; To begin demonstrating the problem, we first need some
; "legacy code" with datastructures and functionality:
@rccursach
rccursach / Gemfile
Last active October 4, 2023 13:08 — forked from daqing/Gemfile
redis_pubsub_demo.rb
source "https://rubygems.org"
gem 'eventmachine'
gem 'sinatra'
gem 'yajl-ruby', require: 'yajl'
gem 'thin'
gem 'em-websocket'
@rxwei
rxwei / ad-manifesto.md
Last active November 9, 2023 09:58
First-Class Automatic Differentiation in Swift: A Manifesto