Skip to content

Instantly share code, notes, and snippets.

View dhess's full-sized avatar

Drew Hess dhess

View GitHub Profile
@dhess
dhess / json-read-fixup.scm
Created January 26, 2009 03:18
Convert vectors in Chicken Scheme json egg output to alists.
;;; The Chicken Scheme json egg provides 2 procedures: json-write and
;;; json-read. json-read represents JSON arrays as Scheme lists and
;;; JSON objects as Scheme vectors, specifically as a vector of dotted
;;; pairs. I like the representation of arrays as lists, but I think
;;; that Scheme association lists (alists) are a better match for JSON
;;; objects, since the latter are a mapping of names to values.
;;;
;;; The following procedure takes the Scheme representation produced by
;;; json-read and converts it to a representation with identical
;;; structure, except that vectors in the json-read representation are
@dhess
dhess / with-current-directory.scm
Created February 10, 2009 09:11
A Chicken Scheme macro for temporarily changing the current working directory
;;; Preserve the current working directory, then change to a new directory
;;; DIR and evaluate THUNK. Finally, restore the working directory and
;;; return THUNK's value.
;;;
;;; Uses dynamic-wind, so it's signal- and continuation-safe.
;;;
;;; Works with Chicken Scheme.
(use posix)
@dhess
dhess / strrep.c
Created May 17, 2011 00:10
strrep - substring replacement in C
/*
* strrep.c - C substring replacement.
*
* Written in 2011 by Drew Hess <[email protected]>.
*
* To the extent possible under law, the author(s) have dedicated all
* copyright and related and neighboring rights to this software to
* the public domain worldwide. This software is distributed without
* any warranty.
*
---
archs: [ i386, x86_64 ]
platform: macosx
install-name: /usr/lib/libSystem.B.dylib
current-version: 1225.1.1
exports:
- archs: [ i386, x86_64 ]
re-exports: [ /usr/lib/system/libcache.dylib, /usr/lib/system/libcommonCrypto.dylib,
/usr/lib/system/libcompiler_rt.dylib, /usr/lib/system/libcopyfile.dylib,
/usr/lib/system/libcorecrypto.dylib, /usr/lib/system/libdispatch.dylib,
{ pkgs }:
{
allowBroken = true;
allowUnfree = true;
haskellPackageOverrides = with pkgs.haskell.lib; self: super: {
# # Example of how to override a package attribute. (Note,
# # however, that there's a much easier way to change this
@dhess
dhess / gist:7905c58299b94e59f1c6c0eaaa7515fd
Last active December 29, 2016 21:15
NVIDIA Tegra TK1 NixOS oops
[ 436.377138] ------------[ cut here ]---
---------
[ 436.384210] WARNING: CPU: 0 PID: 0 at /tmp/nix-build-linux-4.8.8.drv-0/linux-4.8.8/net/sched/sch_generic.c:316 dev_wa
tchdog+0x27c/0x280
[ 436.400201] NETDEV WATCHDOG: enp1s0 (r8169): transmit queue 0 timed out
[ 436.409095] Modules linked in: snd_soc_tegra30_i2s snd_soc_tegra_pcm nls_iso8859_1 nls_cp437 snd_hda_codec_hdmi cfg80
211 snd_soc_tegra_rt5640 nouveau snd_soc_tegra_utils snd_soc_tegra30_ahub snd_hda_tegra snd_soc_rt5640 snd_hda_codec snd
_soc_rl6231 snd_hda_core snd_soc_core snd_pcm_dmaengine xhci_tegra snd_pcm ttm snd_timer tegra_devfreq tegra_wdt ac97_bu
s snd soundcore
[ 436.457640] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.8.8 #1-NixOS
evaluating file ‘/nix/store/kx4s640grkf6wnn0isknjzqk2ajjp35m-nix-1.11.6/share/nix/corepkgs/derivation.nix’
resolved search path element ‘/Users/dhess/git/nixpkgs’ to ‘/Users/dhess/git/nixpkgs’
evaluating file ‘/Users/dhess/git/nixpkgs/lib/minver.nix’
evaluating file ‘/Users/dhess/git/nixpkgs/pkgs/top-level/impure.nix’
evaluating file ‘/Users/dhess/git/nixpkgs/pkgs/top-level/default.nix’
evaluating file ‘/Users/dhess/git/nixpkgs/pkgs/stdenv/booter.nix’
evaluating file ‘/Users/dhess/git/nixpkgs/lib/default.nix’
| evaluating file ‘/Users/dhess/git/nixpkgs/lib/trivial.nix’
| evaluating file ‘/Users/dhess/git/nixpkgs/lib/lists.nix’
| evaluating file ‘/Users/dhess/git/nixpkgs/lib/strings.nix’
{ pkgs }:
{
allowBroken = true;
allowUnfree = true;
packageOverrides = super: let self = super.pkgs; in with self; rec {
#### Global overrides.
{stdenv, fetchurl, dpkg, perl, ncurses5, gmp, libiconv, makeWrapper}:
stdenv.mkDerivation rec {
version = "8.0.2";
name = "ghc-${version}-binary";
src =
if stdenv.system == "x86_64-linux" then
fetchurl {
U-Boot SPL 2016.01-00001-g4eb802e (Jan 13 2016 - 11:14:31)
Trying to boot from MMC
bad magic
U-Boot 2016.01-00001-g4eb802e (Jan 13 2016 - 11:14:31 -0600), Build: jenkins-github_Bootloader-Builder-313
Watchdog enabled
I2C: ready
DRAM: 512 MiB