Skip to content

Instantly share code, notes, and snippets.

rlefevre /
Last active Jun 8, 2020
How to build an elm 0.19.1 binary statically linked to musl libc using docker

Elm 0.19.1 Linux x64 statically linked binary

This document describes how to build a statically linked binary of Elm 0.19.1 for Linux x64 using docker. The binary is built using Alpine Linux in order to easily link it statically to musl libc. This is how the official Elm 0.19.1 Linux binary is built.


Why build a statically linked binary?

Elm is currently distributed using npm. For Linux x64 (but this applies to any architecture), this requires to have a single x64 binary that works on all Linux x64 distributions. This is considerably easier to achieve by building a statically linked binary that will only depend on the Linux kernel ABI and System Call Interface but not on userpace libraries (see here for a compatibility survey of a dynamically built executable).

Why use docker?

stepheneb / register-and-callback-when-available.js
Last active Jan 7, 2020
very simple javascript module dependency manager
View register-and-callback-when-available.js
// This simple module makes available a UUID generator created by Jeff Ward
// This module will be available under the global App.UUID
// After this module has completely loaded it registers itself so other modules that
// depend on it being present can wait until it is available to complete their startup.
* Fast UUID generator, RFC4122 version 4 compliant.
stepheneb /
Last active Jan 8, 2020
JavaScript mixin patterns

JavaScript mixin patterns

Four different ways JavaScript variables and closures can be used to implement different mix-in patterns.

Each implementation creates a mixin that creates property getter functions for model objects.

By model object I mean a function that takes properties (keys and values)( and returns an object that:

stepheneb /
Created Apr 3, 2012
running md2d.js with d8 tracing

Build v8 (creates the d8 executable):

git clone git:// v8-git
cd v8-git/
make dependencies
make native

If you don't have a copy of the lab repo download md2d.js from this gist:

curl -o md2d.js
# first recursive copy of external dir using rsync
$ rsync -avx --delete attachments
receiving file list ... done
created directory attachments

Building the BSD-port version of OpenJDK (Java 1.7) on Mac OS X

Take a look at the comments and code in

$ source

I use after a successful build to copy the new JVM into /usr/local.

I add into my ~/.bash_profile to allow easy switching between multiple JVMs.

echo "
*** generate the documentation for sproutcore and open in a browser:
cd $SPROUTCORE_DEV/sproutcore-git
sc-docs sproutcore
open tmp/docs/sproutcore/index.html
cd $SPROUTCORE_DEV/sproutcore-git
View get-mdns.rb
# file get-mdns.rb
# Create a local git repository in mdns-responder-git of
# Apple's mDNSResponder open source implementation of zeroconf
# See:
# Each mDNSResponder archive located here:
View jnlp_server.rb
require 'rubygems'
gem 'rack', '>= 1.1.0'
gem 'jnlp', '>= 0.6.2'
require 'rack'
require 'jnlp'
require 'fileutils'
require 'open-uri'
You can’t perform that action at this time.