Skip to content

Instantly share code, notes, and snippets.

@arrdem
arrdem / 20-markdown.el
Created January 20, 2017 02:40
My markdown support
;; 20-markdown.el
(require 'markdown-mode)
;; One space per line implementation
(defun arrdem:markdown-nobreak-p ()
"Return nil if it is acceptable to break the current line at the point.
Supports Markdown links, liquid tags."
;; inside in square brackets (e.g., link anchor text)
struct MyVec<T>(T);
impl fmt::Display for MyVec<&Vec<i32>> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "[");
for (i, el) in *(self.0).iter().enumerate() {
if i != 0 {
write!(f, ", ");
}
(ns doc-test
(:require [clojure.test :as t]
[clojure.java.shell :refer [sh]]
[clojure.string :as str]
[clojure.java.io :as io])
(:import [java.io StringReader]))
(def aspell-pattern
#"& (?<word>\w+) (?<offset>\d+) (?<count>\d+): (?<alternatives>.*?)$")
@arrdem
arrdem / PKGBUILD
Created October 29, 2018 09:23
clojure-tools for Arch Linux
# Maintainer: Reid 'arrdem' McKenzie <me@arrdem.com>
pkgname=clojure-tools
pkgver=1.9.0.397
pkgrel=2
pkgdesc="clojure-tools (clj, clojure)"
arch=('i686' 'x86_64')
url="https://clojure.org/guides/getting_started"
license=('EPL')
depends=('java-runtime-headless>=8')
source=("$pkgname-$pkgver.tar.gz")
(ns spec.extras.valid
(:require [clojure.spec.alpha :as s]))
(defn valid!
"`#'s/valid?` but throws an `ex-info` with `#'s/explain-data` of the
failure when `val` doesn't conform to `spec`.
Intended for always-on postconditions because `#'s/assert` is off by
default."
[spec val]
(if (s/valid? spec val)
#!/usr/bin/env -S pex proquint --
"""Compute random proquints as hostnames, throw 'em in zones."""
import sys
from random import randint
from proquint import uint2quint_str
# eight bits of provider addressing
ZONES = {"sfo2", "wbu1"}
#!/usr/bin/env python3
"""Evil monitoring.
Ping hosts, syslogging at INFO if they're up and happy, otherwise using Telnet scripting to force
reset them and syslogging at CRIT with what the uptime was prior to forced reboot.
Hosts are debounced, so that they have a chance to return before monitoring resumes.
No effort is made to detect network conditions or poweroffs.
@arrdem
arrdem / Nat.java
Created September 14, 2019 15:26
A thunk based implementation of natural numbers in Java
package me.arrdem.ox;
import io.lacuna.bifurcan.IList;
import io.lacuna.bifurcan.Lists;
import kotlin.jvm.functions.Function0;
import org.jetbrains.annotations.NotNull;
import java.math.BigInteger;
public final class Nat implements Comparable<Nat> {
---
filters:
- name: Assigned, Reported, Commented and not resolved
jql: |
(assignee = currentUser() OR reporter = currentUser() OR comment ~ currentUser()) AND status != Resolved ORDER BY updated DESC
- name: My open issues
jql: |
assignee = currentUser() AND resolution = Unresolved order by updated DESC
---
openapi: 3.0.0
info:
title: A simple message queue over HTTP
tags:
- name: message
description: |
Operations pertaining to messages.