Skip to content

Instantly share code, notes, and snippets.

@hovissimo
hovissimo / node-red
Last active August 29, 2015 14:04 — forked from bigmonkeyboy/README.md
#! /bin/sh
# Starts and stops Node-RED
# /etc/init.d/node-red
### BEGIN INIT INFO
# Provides: node-red
# Required-Start: $syslog
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Node-RED initialisation
@hovissimo
hovissimo / Magic Gate
Created August 11, 2014 01:55
Magic Gate function for Node-RED, it let's you repeat messages arbitrarily
/* This function node will store the last message it
received as long as msg.payload != "abracadabra".
If this function receives a msg where the payload
exactly equals "abracadabra" then the stored
message will be forwarded.
This function is designed for storing and replaying
messages to help in testing flows. You can use it
by wiring up between two nodes where you want to
control or repeat messages, and also adding an

Keybase proof

I hereby claim:

  • I am hovissimo on github.
  • I am hovis (https://keybase.io/hovis) on keybase.
  • I have a public key whose fingerprint is 5BF2 5C94 C3DE 8B11 09CA 5784 16B8 1A24 21E3 B5F1

To claim this, I am signing this object:

import re
import csv
re_degenerates = re.compile(r"[wsmkrybdhvn]")
def get_patterns(filename):
with open(filename) as f:
lines = f.readlines()[2:] # the first two lines aren't data
for record in csv.reader(lines):
index = record[0] # the first column is the pattern id
import re
import csv
re_degenerates = re.compile(r"[wsmkrybdhvn]")
def get_patterns(filename):
with open(filename) as f:
#lines = f.readlines()[2:] # the first two lines aren't data
lines = f.readlines()
for record in csv.reader(lines):
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="smoothie.js"></script>
<script src="https://cdn.firebase.com/js/client/2.2.0/firebase.js"></script>
</head>
<body>
<h1>Garage temperatures in &deg;C</h1>
@hovissimo
hovissimo / metric radius gauges.jscad
Last active August 29, 2015 14:15
openjscad file for making gauge tools to measure curve radius in mm
/***************************
* Author: Hovis
* File: metric radius gauges.jscad
* Description: This file can be used with openjscad.org to generate 3d models for some tools I designed. The tools are gauges to measure the radii of inside and outside corners by guess-and-check. These 3d models are intended to be easy to print on any 3d printer.
* License: GPL v2
***************************/
function main() {
// These are the mm radii
var sizes = [2, 3, 4, 5, 6, 7];
@hovissimo
hovissimo / config.ini
Created March 2, 2015 05:31
printrbot 1403 hovis config.ini
# generated by Slic3r 1.1.7 on Sun Mar 1 21:30:10 2015
avoid_crossing_perimeters = 0
bed_size = 150,150
bed_temperature = 65
bottom_solid_layers = 2
bridge_acceleration = 5000
bridge_fan_speed = 100
bridge_flow_ratio = 1
bridge_speed = 40
brim_width = 0
@hovissimo
hovissimo / fnByMaxStepDistance.jscad
Last active February 28, 2016 06:09
This function calculates the minimum fn value to turn a curve for a defined feature size. You can use this to optimize render times. This script is designed to be used with the tool at openjscad.org. It is probably most useful for someone who does a lot of 3d printing.
/**** LICENSE
* Copyright (c) 2016 Andrew "Hovis" Biddle
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 all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH T
@hovissimo
hovissimo / slide fit calibration
Created February 3, 2016 01:30
Gcode for a test part (3d printing)
; generated by Slic3r 1.2.9 on 2016-02-02 at 17:23:42
; external perimeters extrusion width = 0.50mm
; perimeters extrusion width = 0.50mm
; infill extrusion width = 0.50mm
; solid infill extrusion width = 0.50mm
; top infill extrusion width = 0.50mm
M107
M190 S60 ; set bed temperature