Skip to content

Instantly share code, notes, and snippets.

View fxtentacle's full-sized avatar

Hajo Nils Krabbenhöft fxtentacle

View GitHub Profile
import numpy as np
import json
# load the project JSON to get the depth scale
with open('/path/to/project/data/subfolder/property.rvproj','rt') as f:
project = json.load(f)
depth_scale = project['scan_param']['depth_scale']
print(depth_scale)
# load projection matrix from 2D to 3D
@fxtentacle
fxtentacle / tf_hang.ipynb
Created April 16, 2020 09:21
TensorFlow problem
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[general]
version = 4
name = Hajo Fine 60 no retr thick Butterfly1
definition = ultimaker2
[metadata]
position = 0
quality_type = normal
type = quality_changes
setting_version = 5
@fxtentacle
fxtentacle / run_me_on_compile.sh
Last active September 24, 2018 05:32
Script to setup Xvfb on Heroku
# symlink libs to where Xvfb searches
ln -s /lib/x86_64-linux-gnu/libudev.so.1 $1/.apt/usr/lib/libudev.so.0
ln -s /app/.apt/usr/lib/x86_64-linux-gnu/libXfont.so.1 $1/.apt/usr/lib/libXfont.so.1
# patch Xvfb to use /app/.. paths instead of hardcoded wrong values
sed -i.bak s/usr\\/bin/app\\/ubi/g $1/.apt/usr/bin/Xvfb
sed -i.bak s/usr\\/share\\/fonts/app\\/usr-s-fonts/g $1/.apt/usr/bin/Xvfb
# create symlinks for Xvfb to use /app/.apt/usr/...
ln -s /app/.apt/usr/bin $1/ubi
ln -s /app/.apt/usr/share/fonts $1/usr-s-fonts
@fxtentacle
fxtentacle / summarize.py
Last active September 25, 2015 10:38 — forked from rodricios/summarize.py
Flipboard's summarization algorithm, sort of
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pip install networkx distance pattern
In Flipboard's article[1], they kindly divulge their interpretation
of the summarization technique called LexRank[2].
@fxtentacle
fxtentacle / gist:156f69cc8eb03a48b5a4
Last active August 29, 2015 14:04
common chinese words
(的 OR 是 OR 否 OR 要 OR 不)
<a href="http://ipv4.download.thinkbroadband.com/5MB.zip"> testlink </a>

How to compile Crypto++ without RTTI (with fake RTTI using templates)

  1. redefine typeid()

In cryptlib.h, I added directly after the initial

#include "config.h" #include "stdcpp.h"

@fxtentacle
fxtentacle / agent.conf
Created October 31, 2011 20:44
Hajo's logstash config
input {
exec {
type => "dstat"
command => "dstat -cdngypms --nocolor 1 0"
interval => 13
}
exec {
type => "apache-benchmark"