Skip to content

Instantly share code, notes, and snippets.

🥝
computers

Vincent Ambo tazjin

🥝
computers
Block or report user

Report or block tazjin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tazjin
tazjin / description.md
Last active Sep 28, 2019
Documentation languages
View description.md

Documentation format popularity

The SQL query below queries the [GitHub dataset on Google BigQuery][bq] for information about the popularity of different documentation formats.

Identification is based on file extensions in this version, and duplicates (e.g. READMEs across forks) are deduplicated by content hashes (which the table uses for the identifiers).

@tazjin
tazjin / knotty.md
Last active Aug 18, 2019
Knotty - a featureless IRC bot
View knotty.md

knotty

(knotty = Nix + bot + y, duh!)


Knotty is an IRC bot with functionality that is defined by its users. It uses the [Nix][] package manager's [language][nix-1p] for all logic.

View layering.md

This program reads an export reference graph (i.e. a graph representing the runtime dependencies of a set of derivations) created by Nix and groups them in a way that is likely to match the grouping for other derivation sets with overlapping dependencies.

This is used to determine which derivations to include in which layers of a container image.

Inputs

@tazjin
tazjin / yants.md
Last active Oct 4, 2019
Yet Another Nix Type System (aka YANTS)
View yants.md

yants

Note: Yants now has its own repository.


This is a tiny type-checker for data in Nix, written in Nix.

Features:

@tazjin
tazjin / nix.md
Last active Aug 1, 2019
Nix Language Overview
View nix.md

This Gist Has Moved!

Please find its new home at github.com/tazjin/nix-1p.

The updated version contains more information and has issue tracking, hooray!


Nix - A One Pager

View keyboard.el
(defun set-xkb-layout (layout)
"Set the current X keyboard layout."
(shell-command (format "setxkbmap %s" layout))
(message "Set X11 keyboard layout to '%s'" layout))
(-map
(lambda (pair)
(exwm-input-set-key
(kbd (format "s-%s" (cadr pair)))
@tazjin
tazjin / thoughts.md
Last active Oct 13, 2019
Nix builder for Kubernetes
View thoughts.md
@tazjin
tazjin / cargo-update.txt
Created Oct 5, 2018
house cleaning in journaldriver
View cargo-update.txt
~/s/journaldriver $ cargo update
Updating registry `https://github.com/rust-lang/crates.io-index`
Removing adler32 v1.0.2
Updating aho-corasick v0.6.4 -> v0.6.8
Removing arrayvec v0.4.7
Adding ascii v0.9.1
Updating atty v0.2.10 -> v0.2.11
Updating backtrace v0.3.8 -> v0.3.9
Updating backtrace-sys v0.1.21 -> v0.1.24
Updating base64 v0.9.1 -> v0.9.3
@tazjin
tazjin / journald_log4rs.rs
Created Sep 24, 2018
journald priority decorator for log4rs
View journald_log4rs.rs
/// Implementation of a log-encoder decorator that can prepend
/// journald log priorities to any given `log4rs`-encoder.
#[derive(Debug)]
struct JournaldDecorator<E: Encode>(E);
/// Helper function to map from `log`-crate log levels to journald log
/// priorites. Please see `sd-daemon(3)` for detailed information on
/// these levels.
fn journald_priority(level: &Level) -> &'static str {
match level {
@tazjin
tazjin / Door.hs
Last active Aug 31, 2018
FSM typeclass demonstration
View Door.hs
{-# LANGUAGE MultiWayIf #-}
-- | This module implements a door that can be opened and closed, and
-- locked/unlocked with a specified code when in closed state.
--
-- The state diagram looks roughly like this (p. simple):
--
-- <--Open--- <--Unlock--
-- [Opened] [Closed] [Locked]
-- --Close--> ----Lock-->
You can’t perform that action at this time.