Skip to content

Instantly share code, notes, and snippets.

View waywardmonkeys's full-sized avatar

Bruce Mitchener waywardmonkeys

View GitHub Profile
@waywardmonkeys
waywardmonkeys / project_manager.rst
Created November 19, 2011 17:09
Rethinking the OD project manager

Rethinking the Project Manager

Problem

The current project manager as a variety of problems that we would like to solve. These include:

  • It combines install with build. Everything is built and installed
@waywardmonkeys
waywardmonkeys / rundeck
Created May 31, 2011 18:08
UFW config for RunDeck
rundeck@xxx:/var/lib/rundeck$ cat /etc/ufw/applications.d/rundeck
[RunDeck]
title=RunDeck
description=RunDeck, a task execution system.
ports=4440/tcp
#pragma D option quiet
#pragma D option aggsortrev
Dylan*:::gf-call-lookup-return
{
generic = copyinstr(arg0);
method = copyinstr(arg1, 45);
@counts[generic, method] = count();
@running_counts[generic, method] = count();
}
Module: dfmc-llvm-back-end
Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
Additional code is Copyright 2009-2010 Gwydion Dylan Maintainers
All rights reserved.
License: Functional Objects Library Public License Version 1.0
Dual-license: GNU Lesser General Public License
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
/// Operating System
avro_datum_t avro_record(const char *name, const char *space)
{
struct avro_record_datum_t *datum =
malloc(sizeof(struct avro_record_datum_t));
if (!datum) {
return NULL;
}
datum->name = strdup(name);
if (!datum->name) {
free(datum);
// a GenAvro file might look like:
// @namespace("wwm")
record timestamp {
long seconds;
long nanoseconds;
}
// @namespace("wwm")
record something {
@waywardmonkeys
waywardmonkeys / calvino-sdl2.dylan
Created June 8, 2015 08:12
First shot at some SDL2 bindings
module: calvino-sdl2
synopsis: bindings for the SDL2 library
author: Bruce Mitchener, Jr.
copyright: See LICENSE file in this distribution.
define constant <uint32-t> = <C-unsigned-int>;
define constant <Uint32> = <uint32-t>;
define inline C-function SDL-Init
@waywardmonkeys
waywardmonkeys / fib.S
Created May 7, 2015 14:03
fib in Dylan and the LLVM backend
libfib.dylib`KfibVfibI:
0x100003e40 <+0>: pushq %rbp
0x100003e41 <+1>: movq %rsp, %rbp
0x100003e44 <+4>: pushq %r14
0x100003e46 <+6>: pushq %rbx
0x100003e47 <+7>: movq %rdi, %rbx
0x100003e4a <+10>: cmpq $0x9, %rbx
0x100003e4e <+14>: jl 0x100003e7b ; <+59> at fib.dylan:10
0x100003e50 <+16>: movq %rbx, %rdi
0x100003e53 <+19>: subq $0x4, %rdi
@waywardmonkeys
waywardmonkeys / factorial.dylan
Created April 5, 2015 14:58
Factorial in Dylan using singleton types
define method factorial (n == 0) 1 end;
define method factorial (n == 1) 1 end;
define method factorial (n)
n * factorial(n - 1)
end;
format-out("%d", factorial(10));
@waywardmonkeys
waywardmonkeys / format.dfm
Last active August 29, 2015 14:16
Some LLVM output
METHOD format-to-string (control-string :: <byte-string>, #next next-method, #rest args) => (result :: <byte-string>)
t10 := [METHOD-CALLi ^{<&method> make (singleton(<byte-string>))}(^{<&class> <byte-string>}, ^#[], ^' ', ^32)]
Vt15 := [STACK-VECTOR (^#"contents", t10, ^#"direction", ^#"output")]
*t15(1) := [CONGRUENT-CALLi ^{<&method> <byte-string-stream> constructor (<class>)}(^{<&class> <byte-string-stream>}, Vt15, ^#unbound-slot-value, ^{<&class> <object>}, ^#f, t10)]
t16 := *t15(1) [0]
[METHOD-CALLi ^{<&method> format (<stream>, <byte-string>)}(t16, {{ control-string }}, {{ args }})]
*t14(1) := [METHOD-CALLi ^{<&method> stream-contents (<sequence-stream>)}(t16, ^#[], ^#t)]
*t7(1) := multiple-value-check-type *t14(1) :: ^{<&class> <byte-string>}
return *t7(1)
END