Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
@dch
dch / erl_nif.rs
Last active August 29, 2015 14:14 — forked from tsloughter/erl_nif.rs
/* automatically generated by rust-bindgen */
pub type ErlNifUInt64 = ::libc::c_ulong;
pub type ErlNifSInt64 = ::libc::c_long;
pub type ERL_NIF_TERM = ::libc::c_ulong;
pub type ERL_NIF_UINT = ERL_NIF_TERM;
pub enum Struct_enif_environment_t { }
pub type ErlNifEnv = Struct_enif_environment_t;
#[repr(C)]
pub struct ErlNifFunc {
@dch
dch / niftest.erl
Last active August 29, 2015 14:14 — forked from LeebDeveloper/niftest.erl
-module(niftest).
-export([add/2]).
-on_load(init/0).
init() ->
ok = erlang:load_nif("./nif", 0).
add(_, _) ->
exit(nif_library_not_loaded).
#!/bin/sh -ex
OCAML_BRANCH=4.02.1
MAKE=make
inst=`pwd`/inst
if [ ! -d inst ]; then
rm -rf opam
git clone git://github.com/ocaml/opam
cd opam
%% @author Masahito Ikuta <[email protected]> [http://d.hatena.ne.jp/cooldaemon/]
%% @copyright Masahito Ikuta 2008
%% @doc UDP Server Behaviour.
%% Copyright 2008 Masahito Ikuta
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
@dch
dch / sushi.erl
Last active August 29, 2015 14:11 — forked from kuenishi/sushi.erl
$ escript sushi.erl
🍣
[Erln8]
color=true
banner=false
default_config=default
system_default=OTP-17.0-dirty
[Repos]
default=https://github.com/erlang/otp.git
[Erlangs]
@dch
dch / dialyzer.mkf
Last active August 29, 2015 14:08 — forked from ericbmerritt/dialyzer.mkf
# -*- mode: Makefile; fill-column: 80; comment-column: 75; -*-
ERL = $(shell which erl)
ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/*/ebin
REBAR=$(shell which rebar)
ifeq ($(REBAR),)
$(error "Rebar not available on this system")
-module(gproc_tests).
-compile(export_all).
-include_lib("stdlib/include/qlc.hrl").
go() -> make:all([load]).
register_stuff() ->
gproc:reg({n, l, key1}, value1),
gproc:reg({n, l, key2}, value2),
gproc:reg({n, l, key3}, value3),
@dch
dch / dnstest
Last active August 29, 2015 14:08 — forked from kunthar/dnstest
λ kunthar : erl
Erlang/OTP 17 [erts-6.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V6.1 (abort with ^G)
2> inet:get_rc().
[{domain,"kunthar.com"},
{search,["kunthar.com"]},
{resolv_conf,"/etc/resolv.conf"},
{hosts_file,"/etc/hosts"},
@dch
dch / kraihlight.vim
Last active August 29, 2015 14:07 — forked from kraih/kraihlight.vim
the excellent kraihlight theme, reverted to a version where the sidebars don't kill my eyes in brilliant fiery red
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "kraihlight"