Skip to content

Instantly share code, notes, and snippets.

View NiklasRosenstein's full-sized avatar
💭
I may be slow to respond.

Niklas Rosenstein NiklasRosenstein

💭
I may be slow to respond.
View GitHub Profile
@NiklasRosenstein
NiklasRosenstein / require.b64-79.py
Last active October 8, 2016 09:54
Blobs for py-require v0.17
# py-require-0.17-b64-79
import base64 as b, types as t, zlib as z; m=t.ModuleType('require'); blob=b'\
eJytGU1v7Lbxvr9CdQ6SnlXZTg4FnCgIGrwCOfQ9oH23xULQailbsSSqpPS8RtD/3pnhkCK1WhdBctn\
lx3A43x9UWVbz9CxVWRbxp/alq3T0L6nFoCfRDtEPyo0H2kyqKX3qq7bLa9n/GO/K8qtQupUDnr/PH/\
4W79p+lGqKhFKDtJN2EmqSstN2oa+Ufq46O5VuY5S6PY/V9GwXprdRuF39pncn0USDVD0CJef0cRcpM\
c1qACQ5ruVu0y5UR83A6a4GJoBF8Z+5VeKjUlIlvxBuGiO2EQBCsH/K09yJn+UwifOUyOOvop4QEikp\
y3Zop7JMtOiaDK/JlOhkdcrqStfVSWTtMHZVLewc4E/iDJBKDIQlwpNEaNG1ekpwlNplg6swf3aRMRX\
8H7VNZAAi0WkR/aOCXwvLtxf8/y5sQGERzBYykezC/O2in0YlR1DtmxEGkl5WXUfCIN6U0HM3FfsDjF\
+f204QGtzhrbwaRzGcEicEZJ2ACu9CwkRKdpaU189VOyQfDJqVYhOymtwo7guMkRiBGi581V9TYZGk2\
auCq8rj2yRqCbL+JAeRlS9CjMBg+9Uu6KmqX05ihDP3RpkzyCPhSzKSQ+4uiJVZj51+CX9VP4tSz03T\
CONTAINER OoffsetYSpline {
INCLUDE Obase;
GROUP ID_OBJECTPROPERTIES {
REAL PY_OFFSETYSPLINE_OFFSET { UNIT METER; }
}
}
# Copyright (c) 2017 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
#!/bin/bash
VERSION=$1
if [ -z "$VERSION" ]; then
echo "no version specified"
exit 1
fi
.local/bin/nocrux gogs stop
wget https://dl.gogs.io/$VERSION/linux_amd64.tar.gz
# Copyright (C) 2017 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
/* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
#!/usr/local/bin/nodepy
choices = {
'S': range(1, 10),
'L': range(1, 5),
'V': range(1, 5),
'H': range(1, 4),
'R': range(1, 4),
'E': range(1, 4),
'C': range(1, 9),
import c4d
def calc_line_plane_intersection(o, d, a, n):
"""
Calculates the intersection of the line described by *o* and *d*
with the plane described by *a* and *n*.
"""
dot = d.Dot(n)
if abs(dot) < 1.0e-7: return None # parallel to plane
# This script creates an image hash database and can then be used
# to copy image files to a directory, but only when they are not
# already in that directory (by the image hash).
from __future__ import print_function
from itertools import islice, izip
from six.moves import range
import argparse
import cPickle
import errno
@NiklasRosenstein
NiklasRosenstein / c4d_IntegrateSplineData.py
Last active November 14, 2017 19:06
Adaptive method for approximating the integral of a c4d.SplineData (i.e. the area "under" the spline).
# Copyright (c) 2016 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in