Skip to content

Instantly share code, notes, and snippets.

View agrueneberg's full-sized avatar

Alexander Grueneberg agrueneberg

View GitHub Profile
@agrueneberg
agrueneberg / push-docs.sh
Last active January 10, 2016 05:25
R staticdoc on Travis
#!/bin/bash
set -e
# Only run on normal commits, ignore pull requests
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
# Clone gh-pages branch into inst/web
git clone --branch gh-pages https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git inst/web
# Copy README
cp README.md inst/web
# Run staticdocs
Rscript -e 'library(staticdocs); library(methods); build_site(launch = FALSE)'
#!/usr/bin/env Rscript
#
# Converts the mice dataset to a BED file that can be used with PLINK and
# BEDMatrix.
#
library(BGLR)
data(mice)
#!/usr/bin/env Rscript
library(BGLR)
data(mice)
gzmice <- gzfile("mice.raw.gz", "w")
write.table(cbind(mice.pheno, mice.X), gzmice, row.names = F, quote = F)
close(gzmice)
@agrueneberg
agrueneberg / generate-random-matrix.c
Created May 23, 2020 15:28
Generates random binary matrices
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char **argv) {
// Get arguments
if (argc != 4) {
fprintf(stderr, "usage: %s nrows ncols filename\n", argv[0]);
@agrueneberg
agrueneberg / ros2json.py
Created April 30, 2023 21:52
ROS messages to JSON and back
import os
import importlib
import rosidl_runtime_py
import json
def get_msg_type(type):
symbol = os.path.basename(type)
module = ".".join(os.path.split(os.path.dirname(type)))
return getattr(importlib.import_module(module), symbol)
@agrueneberg
agrueneberg / ROS2 Complex Parameters
Last active May 3, 2023 08:23
Complex ROS2 parameters via undeclared, namespaced parameters
ros2 param load /mappings mappings2.yaml
@agrueneberg
agrueneberg / gist:f0a3986a35888f1ac67ab529bf99e26c
Last active January 8, 2024 09:37
Lakehouse-focused Trino (Hive, Iceberg, Delta, Hudi)
#!/usr/bin/env bash
#
# Reduce compilation time and size of dependencies by trimming most of the
# plugins unrelated to Lakehouses. Also increases the startup time of the
# Development Server.
#
# Catalogs in testing/trino-server-dev/etc/catalog need to be edited.
#
# Compile project with ./mvnw clean install -DskipTests
#