Skip to content

Instantly share code, notes, and snippets.

//
// producer: OpenJSCAD.org 0.5.1 (2016/06/27) SVG Importer
// date: Thu Jan 05 2017 15:06:22 GMT+0100 (CET)
// source: data.svg
//
function main(params) {
var amaze = maze().scale(0.6).extrude({offset: [0,0,1]});
var bounds = amaze.getBounds();
echo(bounds);
@jonathanperret
jonathanperret / run.tpl
Last active November 2, 2016 11:56 — forked from efrecon/run.tpl
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name={{.Name}} \
{{range $e := .Config.Env}}--env={{printf "%q" $e}} \
{{end}}{{range $p, $conf := .NetworkSettings.Ports}}{{with $conf}}-p {{(index $conf 0).HostIp}}:{{(index $conf 0).HostPort}}:{{$p}} \
{{end}}{{end}}{{range $v := .HostConfig.VolumesFrom}}--volumes-from={{printf "%q" .}} \
{{end}}{{range $v := .HostConfig.Binds}}--volume={{printf "%q" .}} \
{{end}}{{range $l, $v := .Config.Labels}}--label {{printf "%q" $l}}={{printf "%q" $v}} \
{{end}}{{range $v := .HostConfig.CapAdd}}--cap-add {{printf "%q" .}} \
{{end}}{{range $v := .HostConfig.CapDrop}}--cap-drop {{printf "%q" .}} \
{{end}}{{range $d := .HostConfig.Devices}}--device={{printf "%q" (index $d).PathOnHost}}:{{printf "%q" (index $d).PathInContainer}}:{{(index $d).CgroupPermissions}} \
@jonathanperret
jonathanperret / axle.jscad
Last active August 29, 2015 14:23
Krups axle
var hTotal = 91.5,
// longueur des extrémités
hBout = 12,
// profondeur de l'encoche biseautée dans la poignée
hEncoche = 3,
// gorge pour circlip
hGorge = 1,
@jonathanperret
jonathanperret / gist:dfa1f773f8714133752d
Last active August 29, 2015 14:10
OpenJSSCAD X/Y calibration object
// - Set nozzle diameter and layer height below
// - Print with no top/bottom, one shell, same layer height
var nozzle = 0.35,
layer = 0.2;
function fence(side) {
var inside=side-10-nozzle,
outside=side+nozzle;
return cube([outside,outside,0.2])
.center([true,true,false])
@jonathanperret
jonathanperret / post-install.sh
Last active August 29, 2015 13:57
podebal post-install
#!/bin/bash -xe
if [ -d /root ]; then
mkdir -p /root/.ssh
keysfile=/root/.ssh/authorized_keys
else
mkdir -p /etc/ssh/keys-root
keysfile=/etc/ssh/keys-root/authorized_keys
fi
void setup() {
}
int NONE = -1;
int actualPins[] = {2, 3, 4};
void set(int pin, int st) {
int actualPin = actualPins[pin];
if(st == NONE) {