Skip to content

Instantly share code, notes, and snippets.

@blind-coder
blind-coder / abs2rel.pl
Last active December 6, 2018 09:42
Simple GCode Absolute Extrusion to Relative Extrusion converter
#!/usr/bin/perl -w
# 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
bcUtils.dump = function(o, lvl) -- {{{ Small function to dump an object.
if lvl == nil then lvl = 5 end
if lvl < 0 then return "SO ("..tostring(o)..")" end
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if k == "prev" or k == "next" then
s = s .. '['..k..'] = '..tostring(v);
else
@blind-coder
blind-coder / gist:3acbfe028b7426492bfc
Created June 21, 2015 18:11
Project Zomboid ISRichText in a ISCollapsableWindow
function BCMapMod.onResize(self)
ISCollapsableWindow.onResize(self);
self.panel:setWidth(self:getWidth());
self.panel:setHeight(self:getHeight() - (self:titleBarHeight() + self:resizeWidgetHeight()));
self.panel:onResize();
self.richtext:setWidth(self.panel:getWidth());
self.richtext:setHeight(self.panel:getHeight());
self.richtext:onResize();
@blind-coder
blind-coder / gist:3e1830cf40ad4f6a37b9
Created April 30, 2015 07:53
ViFit Pedometer dump
Steps: 3412
Notification handle = 0x0038 value: 43 f0 15 04 30 00 00 00 00 00 00 00 00 00 00 7c
Notification handle = 0x0038 value: 43 f0 15 04 30 01 00 00 00 00 00 00 00 00 00 7d
Notification handle = 0x0038 value: 43 f0 15 04 30 02 00 00 00 00 00 00 00 00 00 7e
Notification handle = 0x0038 value: 43 f0 15 04 30 03 00 00 00 00 00 00 00 00 00 7f
Notification handle = 0x0038 value: 43 f0 15 04 30 04 00 00 00 00 00 00 00 00 00 80
Notification handle = 0x0038 value: 43 f0 15 04 30 05 00 00 00 00 00 00 00 00 00 81
Notification handle = 0x0038 value: 43 f0 15 04 30 06 00 00 00 00 00 00 00 00 00 82
Notification handle = 0x0038 value: 43 f0 15 04 30 07 00 00 00 00 00 00 00 00 00 83
@blind-coder
blind-coder / gist:cca61c0e8e1cb778537a
Created April 28, 2015 08:44
PZ inheritance mockup
Interpretation 1: Inherit specific item, modify it.
Implementation: probably easy
Impact on existing codebase: small to nonexistant.
Impact on future development: medium for mods changing existing items.
Advantages: changing only specific attributes of an item does not necessitate keeping all attributes in sync.
Disadvantages: unknown.
Example: Extending Bleach item:
Old:
module Base
@blind-coder
blind-coder / gist:16a54d0f8908ce154bc0
Created April 20, 2015 12:58
ExpirationFood German Translation
UI_DE =
{
UI_trait_foodexpiration = "Lebensmittelkenner",
UI_trait_foodexpiration_des = "Du weisst genau, wann Lebensmittel schlecht werden.",
UI_tooltip = "Verfallsdatum prüfen",
UI_status_VERYGOOD = "Sehr frisch",
UI_status_GOOD = "Frisch",
UI_status_NORMAL = "Okay",
UI_status_LITTLEROTTEN = "Etwas angeschimmelt",
UI_status_ALMOSTROTTEN = "Fast verschimmelt",

Keybase proof

I hereby claim:

  • I am blind-coder on github.
  • I am blindcoder (https://keybase.io/blindcoder) on keybase.
  • I have a public key whose fingerprint is 6288 CDCD 6B81 D0E8 512C 5256 405E EE27 3991 FB33

To claim this, I am signing this object:

@blind-coder
blind-coder / gist:4948038
Last active December 13, 2015 17:29
Quick'n'dirty howto on getting gitlab up and running in a smartos zone.
# Install necessary packages
pkgin up
pkgin -y install \
bash \
coreutils-8.13nb4 \
curl \
gcc47-4.7.0nb2 \
gcc47-runtime-4.7.0nb2 \
gmake-3.82nb5 \
icu-49.1.1nb1 \
#!/bin/bash
#
# SCRIPT: do-smartmachine-dataset.sh
# AUTHOR: Mark Slatem
# DATE: 16 January 2013
# REV: 1.0
#
# PLATFORM: SmartOS
# REQUIREMENTS: SmartOS
#
2013-02-13 23:54:37 =ERROR REPORT====
** State machine {vm,<<"eef4d5b6-2932-45b7-912d-64e870a9677d">>} terminating
** Last event in was {create,[{<<"cpu_cap">>,200},{<<"name">>,<<"gitlab">>},{<<"quota">>,6144},{<<"ram">>,2048},{<<"requirements">>,[]},{<<"uuid">>,<<"6aa5463c-c8e0-40e2-92be-a13e1fdd2cb5">>},{<<"version">>,<<"0.1.0">>}],[{<<"dataset">>,<<"fdea06b0-3f24-11e2-ac50-0b645575ce9d">>},{<<"description">>,<<"Base image with core packages preinstalled">>},{<<"name">>,<<"base64">>},{<<"networks">>,[[{<<"gateway">>,<<"192.168.100.1">>},{<<"ip">>,<<"192.168.100.111">>},{<<"netmask">>,<<"255.255.255.0">>},{<<"nic_tag">>,<<"external">>}]]},{<<"os">>,<<"smartos">>},{<<"type">>,<<"zone">>},{<<"version">>,<<"1.8.4">>}],[{<<"admin_pw">>,<<"123">>},{<<"alias">>,<<"gitlab">>},{<<"hostname">>,<<"gitlab">>},{<<"metadata">>,[{}]},{<<"networks">>,[{<<"net0">>,<<"92a234f4-e86c-4d0f-a0c7-e9fd3cbdf3de">>}]},{<<"owner">>,<<"f373a3a1-8c38-4346-b6cd-6447a5290001">>},{<<"root_pw">>,<<"123">>}]}
** When State == initialized
*