Skip to content

Instantly share code, notes, and snippets.

View tomlankhorst's full-sized avatar
🌊

Tom Lankhorst tomlankhorst

🌊
View GitHub Profile
@tomlankhorst
tomlankhorst / invensense-license.txt
Last active June 15, 2016 16:23
INVENSENSE EMBEDDED MOTIONAPPS™ SOFTWARE LICENSE AGREEMENT
INVENSENSE EMBEDDED MOTIONAPPS™ SOFTWARE LICENSE AGREEMENT
IMPORTANT: PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY BEFORE DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING THE SOFTWARE PROVIDED UNDER THIS AGREEMENT. This Software License Agreement (“Agreement”) is a binding legal agreement between InvenSense, Inc. located at 1197 Borregas Ave, Sunnyvale, CA 94089 ( “InvenSense”) and you (both the individual installing the Software and any single legal entity on behalf of which such individual is acting) (“Licensee”). By selecting “I ACCEPT” below, or by downloading, installing, copying or otherwise using the Software, Licensee acknowledges that it, he or she has read all of the terms and conditions of this Agreement, understands them, and agrees to be bound by them. IF YOU DO NOT AGREE TO ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT, YOU MUST NOT DOWNLOAD, INSTALL, COPY, OR OTHERWISE USE THE SOFTWARE.
1. PURPOSE
This Agreement provides the terms and conditions for Licensee’s licen
@tomlankhorst
tomlankhorst / # haptix-comm - 2018-02-14_10-02-16.txt
Created February 14, 2018 09:03
haptix-comm (osrf/simulation/haptix-comm) on macOS 10.13.3 - Homebrew build logs
Homebrew build logs for osrf/simulation/haptix-comm on macOS 10.13.3
Build date: 2018-02-14 10:02:16
@tomlankhorst
tomlankhorst / MigrationsCompiler.php
Created April 12, 2019 09:38
Laravel Migrations Compiler
<?php
namespace Tests;
/**
* This class fakes all migrations and builds a single SQL file that is stored in the /tests folder.
* Then, the corresponding SQL can be used to build a fresh new table.
*
* Simply run in your TestCase setup:
* ```
@tomlankhorst
tomlankhorst / benchmark.cpp
Created November 28, 2019 22:57
Eigen benchmark for 3D vector multiplication
#include <eigen3/Eigen/StdVector>
#include <iostream>
#include <random>
#include <vector>
#include <benchmark/benchmark.h>
template<typename Vector_>
using AlignedVector = std::vector<Vector_, Eigen::aligned_allocator<Vector_>>;
@tomlankhorst
tomlankhorst / authorized_keys.sh
Created March 21, 2020 16:33
AuthorizedKeysCommand that appends a public list of keys to the user's list.
#!/bin/bash
# USE AT OWN RISK
# Current user
USER=$1
HOME=$(eval echo ~$USER)
# Base keys
cat $HOME/.ssh/authorized_keys
<VirtualHost *:443>
ServerName service.com
# Set CORS headers to allow XHR
# Determine if Origin matches the regex
SetEnvIf Origin "http(s)?://(www.api-client.com|beta.api-client.com:8000)$" AccessControlAllowOrigin=$0
# Set Access-Control-Allow-Origin if the Origin is allowd
Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
Header always set Access-Control-Allow-Credentials true
Header always set Access-Control-Allow-Headers "Origin, Authorization, Accept"
@tomlankhorst
tomlankhorst / thanks
Last active April 29, 2020 07:31
⭐ Thanks! Star the current GitHub repository.
#!/usr/bin/env python3
import os
import re
import requests
from subprocess import check_output
github_origin_re = r"^(git@github\.com:|https:\/\/github.com\/)([\w\-_]+)\/([\w\-_]+)\.git$"
try:
// https://javadoc.jenkins.io/jenkins/model/Jenkins.html#getItemByFullName-java.lang.String-
def organization = Hudson.instance.getItemByFullName('my_organization')
if (!organization) throw new Exception("No organization by that name")
// https://javadoc.jenkins.io/plugin/cloudbees-folder/com/cloudbees/hudson/plugins/folder/AbstractFolder.html#getItems--
def jobs = organization.getItems()
jobs.each {
// find the sub-job that's named "master"
// https://javadoc.jenkins.io/hudson/model/Item.html#getName--
master = it.items.find { it.getName() == "master" }
@tomlankhorst
tomlankhorst / talker_listener_ros.launch
Last active June 3, 2020 10:08
Launch ROS nodes in a docker container (roscpp_tutorial/talker_listener). This example uses host networking, but creating a network and setting the ROS_MASTER_URI should work just as well. See: https://github.com/ros/ros_tutorials/tree/melodic-devel/roscpp_tutorials https://hub.docker.com/_/ros/
<launch>
<node launch-prefix="docker run --rm --name listener -v$HOME:$HOME -u$UID --privileged --net=host -eROS_HOME=$ROS_HOME ros:melodic-ros-base-bionic" name="listener" pkg="roscpp_tutorials" type="listener" output="screen"/>
<node launch-prefix="docker run --rm --name talker -v$HOME:$HOME -u$UID --privileged --net=host -eROS_HOME=$ROS_HOME ros:melodic-ros-base-bionic" name="talker" pkg="roscpp_tutorials" type="talker" output="screen"/>
</launch>
@tomlankhorst
tomlankhorst / decay_optional.hpp
Created April 14, 2021 07:40
Decay optional type
template<typename T>
struct decay_optional {
using type = T;
};
template<typename T>
struct decay_optional<std::optional<T>> {
using type = T;
};