Skip to content

Instantly share code, notes, and snippets.

View davexunit's full-sized avatar

David Thompson davexunit

View GitHub Profile
@davexunit
davexunit / hello.scm
Last active December 14, 2018 13:01
chickadee hello world example
(use-modules (chickadee)
(chickadee math vector)
(chickadee render font))
(define (draw alpha)
(draw-text "Hello, world!" #v(260.0 240.0)))
(run-game #:draw draw)
@davexunit
davexunit / cfn-example.scm
Last active November 30, 2018 17:28
Functional, declarative CloudFormation template generation with Scheme - https://git.dthompson.us/guile-cloudformation.git
(use-modules (aws cloudformation)
(aws cloudformation ec2)
(aws cloudformation s3)
(aws cloudformation utils json)
(oop goops))
(define security-group
(make <security-group>
#:id 'security-group
#:group-description "CFN Test"

In order to get into a trustworthy state, the [big data] toolchain needs to:

  • Consolidate. There are too many tools for every job. There are even too many tools to manage your too many tools, and frontends for your frontends.

  • Lose weight. Every project depends on way too many other projects, each of which only contributes a tiny fragment for a very specific use case. Get rid of most dependencies!

  • Modularize. If you can't get rid of a dependency, but it is still only of

@davexunit
davexunit / package.scm
Last active September 4, 2015 23:25
guix environment for passenger_status_check
;;; Commentary:
;;
;; Development environment for GNU Guix.
;;
;;; Code:
(use-modules (guix packages)
(guix licenses)
(guix build-system ruby)
(gnu packages)
@davexunit
davexunit / gist:a70d61517026ea4d63f9
Created June 17, 2015 13:43
quick look at a portion of the cgroup hierarchy created by Docker
dthompson@7VWJD42 ~$ ls /sys/fs/cgroup/{cpu,cpuset,freezer,memory}/docker
/sys/fs/cgroup/cpu/docker:
22c135c046be860d64a53e2d5ab229a36f9c2132b2d3d5c1cd88b742aad6ad02/ cgroup.clone_children cgroup.event_control cgroup.procs cpu.cfs_period_us cpu.cfs_quota_us cpu.shares cpu.stat notify_on_release tasks
/sys/fs/cgroup/cpuset/docker:
22c135c046be860d64a53e2d5ab229a36f9c2132b2d3d5c1cd88b742aad6ad02/ cgroup.procs cpuset.mem_exclusive cpuset.memory_pressure cpuset.mems notify_on_release
cgroup.clone_children cpuset.cpu_exclusive cpuset.mem_hardwall cpuset.memory_spread_page cpuset.sched_load_balance tasks
cgroup.event_control cpuset.cpus cpuset.memory_migrate cpuset.memory_spread_slab cpuset.sched_relax_domain_level
/sys/fs/cgroup/freezer/docker:
@davexunit
davexunit / gist:5ca5cae26343bfa577ad
Created June 17, 2015 13:27
analysis of a Docker container's namespaces vs. a process in the initial namespaces
dthompson@7VWJD42 ~$ sudo readlink /proc/17196/ns/mnt
mnt:[4026532449]
dthompson@7VWJD42 ~$ sudo readlink /proc/$$/ns/mnt
mnt:[4026531840]
dthompson@7VWJD42 ~$ sudo readlink /proc/17196/ns/ipc
ipc:[4026532451]
dthompson@7VWJD42 ~$ sudo readlink /proc/$$/ns/ipc
ipc:[4026531839]
dthompson@7VWJD42 ~$ sudo readlink /proc/17196/ns/user
user:[4026531837]
@davexunit
davexunit / gist:543882be69f2f9fa0f91
Created June 16, 2015 19:28
Install Docker on Ubuntu without piping some random script into a shell with root privileges
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
echo "deb https://get.docker.com/ubuntu docker main" > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install lxc-docker
;;; 2048
;;; Copyright (C) 2014 David Thompson <dthompson2@worcester.edu>
;;; Copyright (C) 2014 Jordan Russell <jordan.likes.curry@gmail.com>
;;;
;;; This program is free software: you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
;;; published by the Free Software Foundation, either version 3 of the
;;; License, or (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
Here is a really small patch for guile-figl that fixes errors when generating docs from texinfo files.
---
doc/gl.texi | 2 +-
doc/low-level-gl.texi | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/doc/gl.texi b/doc/gl.texi
index 0c77e8f..b0d6f01 100644
--- a/doc/gl.texi
@davexunit
davexunit / surface-pixels.patch
Last active December 18, 2015 23:48
guile-sdl surface-pixels patch
--- src/sdlsurface.c 2013-05-24 18:03:03.156043808 -0400
+++ src/sdlsurface.c 2013-06-06 21:19:03.591137715 -0400
@@ -170,6 +170,33 @@
#undef FUNC_NAME
}
+PRIMPROC
+ (surface_pixels, "surface-pixels", 1, 0, 0,
+ (SCM surface),
+ doc: /***********