Skip to content

Instantly share code, notes, and snippets.

View tillsc's full-sized avatar

Till Schulte-Coerne tillsc

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tillsc on github.
  • I am tillsc (https://keybase.io/tillsc) on keybase.
  • I have a public key whose fingerprint is F789 21B7 A0EA 859A DDB8 97F8 E861 8608 B8CF E1E1

To claim this, I am signing this object:

@tillsc
tillsc / dm-to_xlsx.rb
Last active August 29, 2015 14:26
to_xlsx for DataMapper
# -*- encoding : utf-8 -*-
module DataMapper
module Xlsx
module Model
def xlsx_columns
self.properties.reject{ |p| p.options[:no_export] }.
sort{ |a, b| (a.options[:export_pos] || 0) <=> (b.options[:export_pos] || 0) }.
@tillsc
tillsc / galen-setup.js
Last active September 28, 2015 14:39
galen setup script tying to fix `clientWidth` in Browsers showing a vertical scrollbar
function setup() {
// create driver and other stuff
// ...
driver.get(url);
var realWidth = inject(driver, 'return document.documentElement.clientWidth');
if (realWidth < size.width) {
var w = 2 * size.width - realWidth;
@tillsc
tillsc / can_ids.md
Last active February 28, 2019 11:29
Brunner CAN IDs

BHZ 3.0 - 1.82

Bei sämtlichen hier aufgeführten Paketen handelt es sich um 4 Byte Daten. Das letzte Byte ist immer 0x00 und muss weg gelassen werden.

Temperaturen

ID Name Einh.
0x1c104009 VL HK1 (S1) °C/10
0x1c10400a VL HK2 (S2) °C/10
@tillsc
tillsc / end.gcode
Last active November 21, 2022 20:59
GCodes for Sidewinder X1
M42 P4 S255 ; led green
M42 P5 S50 ; led red
M42 P6 S50 ; led blue
M104 S0 ; nozzle heater off
M140 S0 ; bed heater off
G92 E1 ; relative positioning mode
G1 E-1 F300 ; Retract the filament
G28 X ; Home the X axis
G0 Y280 F600 ; Bring the bed to the front for easy print removal
@tillsc
tillsc / query.flex
Last active January 3, 2021 13:46
query influx data with unevenly distributed points
// Replace this with your specific query/selection
base = from(bucket: "hassio")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "kw")
|> filter(fn: (r) => r["entity_id"] =~ /bhz3_leistung_zus/)
|> filter(fn: (r) => r["_field"] == "value")
|> window(every: v.windowPeriod)
|> sort(columns: ["_time"], desc: false)
// This does NOT caclulate the correct mean (maybe `timeWeightedAvg` would be the right choice here but I couldn't