Skip to content

Instantly share code, notes, and snippets.

View EleotleCram's full-sized avatar

Marcel Toele EleotleCram

  • Amsterdam, The Netherlands
View GitHub Profile
@EleotleCram
EleotleCram / every.h
Last active May 29, 2021 21:47
Simple Arduino non-blocking interval macros
#pragma once
// Utility macros for periodically doing stuff in a non-blocking loop.
// Usage:
//
// void loop() {
// EVERY(2.5 SECONDS) {
// static bool ledOn = false;
// ledOn = !ledOn;
@EleotleCram
EleotleCram / autocadass
Created April 13, 2021 19:06
Automation utility for conversion of CAD input files (.step, etc.) to .obj files using CAD Assistant, xdotool and xprop.
#! /bin/bash
# Auto CAD Assistant - Automation utility for conversion of CAD input files (.step, etc.) to .obj
# files using CAD Assistant, xdotool and xprop. Just give it a bunch of input CAD files and behold
# the robot as it automatically navigates and operates CAD Assistant.
# MIT License
#
# Copyright (c) 2021 Marcel Toele
#
@EleotleCram
EleotleCram / google-image-search-dim-overlay.tampermonkey.js
Last active September 19, 2023 00:11
Tampermonkey script that adds back the dimension overlay in Google Image Search
// ==UserScript==
// @name Google Image Search Dimension Overlay
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Tampermonkey script that adds back the dimension overlay in Google Image Search
// @author EleotleCram
// @match https://www.google.com/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js
// @grant none
// ==/UserScript==
@EleotleCram
EleotleCram / arduino-tools-and-projects.md
Created August 28, 2020 18:21
Arduino Tools and Projects

Repositories:

@EleotleCram
EleotleCram / blender-tools-and-projects.md
Last active January 2, 2021 15:57
Blender Tools and Projects
// arrayDepth() => 0
// arrayDepth([]) => 1
// arrayDepth([[]]) => 2
// arrayDepth([[[]]]) => 3
// arrayDepth([[[[]]]]) => 4
const arrayDepth = (ary) => _.isArray(ary) ? 1+arrayDepth(ary[0]) : 0;
@EleotleCram
EleotleCram / bus.js
Last active March 7, 2017 13:23
drop-in synchronous bus gist using jquery-node
const $ = require('jquery-node');
// Description: drop-in synchronous bus gist using jquery-node
// Usage:
//
// bus.on("foo", (...args) => {
// console.log("foo was triggered", args);
// });
// bus.subscribe({
// onFoo(...args) {console.log("foo triggered too", args)}
@EleotleCram
EleotleCram / aprintf
Last active April 16, 2023 05:14
Simple arduino formatted printf
int aprintf(char *str, ...) {
int i, j, count = 0;
va_list argv;
va_start(argv, str);
for(i = 0, j = 0; str[i] != '\0'; i++) {
if (str[i] == '%') {
count++;
Serial.write(reinterpret_cast<const uint8_t*>(str+j), i-j);