Skip to content

Instantly share code, notes, and snippets.

jelford /
Last active April 21, 2023 14:42
Read Numerai dataset by Era
import pyarrow.dataset as ds
def load(source_file: str, eras=None, features=None) -> pd.DataFrame:
source_file = str(source_file)
if eras is None:
eras = eras_from_file(source_file)
if features is None:
features = feature_names(source_file)
jelford / self-pipe-trick.c
Last active October 31, 2021 15:15
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 October 31, 2021 12:20
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 April 4, 2021 16:12
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 August 21, 2020 09:16
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 August 29, 2015 13:57
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 December 22, 2015 10:49
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();