Skip to content

Instantly share code, notes, and snippets.

jelford / self-pipe-trick.c
Last active Oct 31, 2021
a short snippet demonstrating djb's self-pipe trick in c
View self-pipe-trick.c
// compiles with: gcc -Wall -Werror -pedantic ./selfpipetrick.c -o selfpipetrick
// You can quit by suspending with Ctrl-Z and then sending a `kill -9`
#include <sys/signalfd.h>
#include <signal.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
jelford / signalfd.c
Created Oct 31, 2021
A small app that demonstrates using signalfd to handle signals in a normal thread context
View signalfd.c
// Error handling omitted for brevity
// compile with: gcc signalfd.c -o signalfd
#include <sys/signalfd.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <poll.h>
jelford / Cargo.toml
Created Apr 4, 2021
View Cargo.toml
name = "example"
version = "0.1.0"
authors = ["James Elford <>"]
edition = "2018"
# See more keys and their definitions at
libc = "0.2"
jelford / Contailerfile
Created Aug 21, 2020
Toolbox for setting up RingCentral Meetings
View Contailerfile
RUN set pipefail && \
dnf update --all -y && \
curl -sSLo "ringcentral_x86_64.rpm" "" && \
dnf localinstall -y "ringcentral_x86_64.rpm" && \
dnf clean all
# build with `podman build -t ringcentral-image .
# init toolbox with `toolbox create -i ringcentral-image -c ringcentral
jelford / log.css
Last active Aug 29, 2015
Quick and dirty log panel when console.log isn't available
View log.css
#log {
max-height: 10em;
height: 10em;
overflow-y: scroll;
position: fixed;
right: 0;
top: 0;
jelford /
Last active Dec 22, 2015
This will bite you if you use Guava's ImmutableX types.
public class AppTest
@Rule public JUnitRuleMockery context = new JUnitRuleMockery();
public static interface ColGetter {
public abstract Col get();
public static interface NonColGetter {
public abstract NonCol get();